I created a mobile application using jQuery Mobile and built it for iOS and Android via PhoneGap Build v2.5. Then I successfully added inmobi declarations using their javascript api. The ad shows just fine, but the problem occurs when the user clicks on the ad when the ad accepts the application. This is not a problem in Android, as users have a back button, but on iOS devices the user is stuck and cannot return to my application.
I have successfully configured all the external links contained in my application to open them in the device browser, passing all the URL to this function:
function openNewBrowser(url) { window.open(encodeURI(url), '_system'); return false; }
But the inmobi declaration is inside the iframe in my application, and I can not control how they pass their url. I also tried linking jQuery Mobile to catch all the events on the site and process them using:
$(document).bind("pagebeforechange", function(e, data) { if(typeof data.toPage === 'object' || data.toPage.indexOf("index.html#") >= 0) {
but "else" never fires. The inmobi ad just captures the application and the user is forced to kill and restart the application back to usable state. Is there any other event that I should listen to?
This is how I call the inmobi declaration:
var inmobi_conf = { siteid : "*******mySiteId*******", slot : "15", manual: true, test: true, targetWindow: "_blank" };
I would (and try) set "targetWindow" to _system, but the only valid parameters are _blank and _top.
Does anyone know how to get iFrame links (which you cannot install in _system) to open in their own browser instead of grabbing the application or getting an inmobi ad so as not to take over the application?