ANDROID INAPPBROWSER EVENTS NOT FIRING IN PHONEGAP BUILD

Pravesh Singh

Total Post:101

Points:709
Posted by  Pravesh Singh
 3578  View(s)
Ratings:
Rate this:
Hi Guys

I'm loading an external page with InAppBrowser and it seems like neither loadstart nor loadstop are been fired on Android. 

My line of code as following

var ref = window.open(url, '_blank', 'location=yes;');
ref.addEventListener('loadstart', function() {
    console.log('loadstart!');
    console.log(event.url);
});

Thanks 
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: Android InAppBrowser events not firing in phonegap build

    Hi Pravesh!


    Try as following...

    Make sure you load the right cordova-2.x.x.js file

    // Platform: android

    Include the InAppBrowser plugin in res/xml/config.xml

    <plugin name="InAppBrowser" value="org.apache.cordova.InAppBrowser" />

    Write the correct white-list tag (differs from iOS)

    <access origin="https://domain.com" subdomains="true" />

    You really have to include onDeviceReady like in the example files, that did the trick for me.

    document.addEventListener('deviceready', app.onDeviceReady, false);

    I hope it helpful for you.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!