Note that there are some explanatory texts on larger screens.

plurals
  1. POOpen InMobi iframe link in device browser (phonegap build)
    primarykey
    data
    text
    <p>I have created a mobile app using jQuery Mobile and built it for iOS and Android via PhoneGap Build v2.5. I then successfully added inmobi advertisements using their javascript api. The ad displays just fine but the problem comes when a user clicks the ad as the ad takes over the app. This isn't such an issue in Android as users have a back button but on iOS devices the user is stuck and unable to get back to my app.</p> <p>I have successfully set up all external links contained in my app to open in the device's browser by passing all url's to this function:</p> <pre><code>function openNewBrowser(url) { window.open(encodeURI(url), '_system'); return false; } </code></pre> <p>But the inmobi ad is inside of an iframe in my app and I have no control over how they pass their url's. I have also tried to bind jQuery Mobile to catch all pagebeforechange events and process them accordingly using:</p> <pre><code>$(document).bind("pagebeforechange", function(e, data) { if(typeof data.toPage === 'object' || data.toPage.indexOf("index.html#") &gt;= 0) { //internal URL so do nothing } else { //external URL so send to openNewBrowser console.log('page is external'); openNewBrowser(data.toPage); e.stopPropagation(); return false; } }); </code></pre> <p>but the "else" is never tripped. The inmobi ad just takes over the app and user is forced to kill and restart the app back to a usable state. Is there a different event I should be listening for?</p> <p>Here is how I am calling the inmobi ad:</p> <pre><code>var inmobi_conf = { siteid : "*******mySiteId*******", slot : "15", manual: true, test: true, targetWindow: "_blank" }; </code></pre> <p>I would (and have tried to) set the "targetWindow" to _system but the only valid parameters are "_blank" and "_top".</p> <p>Does anyone know of a way to get iFrame links (that you cant set to _system) to open in the native browser instead of taking over the app or gotten inmobi ad's to not take over the app?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload