13

I have a webapp that I’m using with PhoneGap/Cordova to install in iOS and Android. At one point in the app I have an iframe that loads content from a second server.

When I run the app from a browser, everything works as expected – the iframe opens in the same page and loads the content from the second site.

When I run the webapp on an iPhone simulator using Cordova, when the iframe opens, iOS switches over to Safari and puts my app in the background.

Steps taken:

  1. I added the second site to the “ExternalHosts” array in the Cordova.plist file.
  2. I created a config.xml file next to the index.html file in the /www directory, according to the PhoneGap/Cordova documentation (https://build.phonegap.com/docs/config-xml).
  3. I added a <preference name=”stay-in-webview” value=”true” /> tag to the config.xml file as a child of the main <widget> tag.

My suspicion is that it is not reading/using the config.xml file, but there could be something else… Does anyone have any ideas what I might be doing wrong?