Error: Invalid resource directory name for splash - ios

I have a Nuxt JS / Cordova 8.0.0 project with a few plugins. I'm trying to add custom splash screens to the project, and have added them inside of res/screen/android/
Every time I try to compile the project, I get the following error when building for Android:
`Execution failed for task ':app:mergeDebugResources'.
/Applications/MAMP/htdocs/project-beacon/cordova/platforms/android/app/src/main/res/drawable-xhdpi-portrait: Error: Invalid resource directory name`
This is really frustrating.
I have my config.xml file setup as follows:
<platform name="android">
<preference name="SplashMaintainAspectRatio" value="true" />
<icon density="ldpi" height="36" src="res/icon/android/icon-36-ldpi.png" width="36" />
<icon density="mdpi" height="48" src="res/icon/android/icon-48-mdpi.png" width="48" />
<icon density="hdpi" height="72" src="res/icon/android/icon-72-hdpi.png" width="72" />
<icon density="xhdpi" height="96" src="res/icon/android/icon-96-xhdpi.png" width="96" />
<splash density="port-xhdpi" src="res/screen/android/screen-xhdpi-portrait.png" />
<splash src="res/splash/android/Default#2x~universal~anyany.png" />
<allow-intent href="market:*" />
<custom-config-file parent="/*" target="AndroidManifest.xml">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
</custom-config-file>
</platform>
Originally, I had a load of splash screens, but due to the error, I've removed them to see if it would fix it. I have tried changing the file names and everything.

You have 2 <platform name="android">
Also you have <splash src="res/splash/android/Default#2x~universal~anyany.png" /> which has no density, remove it.

Related

PhoneGap App stopped loading to Apple Test Flight with Icon Missing Error. Worked OK until a month or two ago

Our latest build of a PhoneGap application for iOS and Android, was built OK on the ADOBE PhoneGap build site.
When we attempt to load it from an Apple MAC onto the Apple Test Flight system, we get this error:
"Missing App Icon..."
1
This relates to the App Store Icon 1024x1024
We are now on version 24 of the App - so 23 previous versions built and loaded OK.
We have set up all the necessary Apple IDs etc. (and all has been working fine) although in the past we used to get a WARNING about the missing Icon, now the Load just stops.
We have contacted Apple Support who suggested rebuilding and trying again. Not made any difference...
I have found a number of articles that suggest we needed to update our CONFIG.XML file, with details of the icon with size 1024x1024, and also to use PhoneGap CLI 7.1.0. No success.
here is the CONFIG file (or at least the relevant bits)
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.cognect.mobile" version="1.0.24" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<content src="index.html" />
<preference name="DisallowOverscroll" value="true" />
<preference name="phone-gap-version" value="cli-7.1.0" />
<preference name="android-minSdkVersion" value="17" />
<plugin name="cordova-plugin-battery-status" source="npm" spec="~1.1.1" />
<and a whole load more plugins...>
<platform name="ios">
<icon platform="ios" src="www/res/icon/ios/icon.png" width="1024" height="1024" />
<icon height="114" platform="ios" src="www/res/icon/ios/icon#2x.png" width="114" />
<icon height="40" platform="ios" src="www/res/icon/ios/icon-40.png" width="40" />
<and a whole load more icons....>
<splash height="1136" platform="ios" src="www/res/screen/ios/Default-568h#2x~iphone.png" width="640" />
<splash height="768" platform="ios" src="www/res/screen/ios/Default-Landscape~ipad.png" width="1024" />
<splash height="2048" platform="ios" src="www/res/screen/ios/Default-Portrait#2x~ipad.png" width="1536" />
<splash height="1024" platform="ios" src="www/res/screen/ios/Default-Portrait~ipad.png" width="768" />
</platform>

Cordova app reloads itself on iOS 12, iPhoneX

I have an iOS app developed using Cordova (ios engine 4.4.0) in TestFlight. It all works great, except with the latest iOS 12 beta.
Users reported that the app restarts itself randomly on iOS 12 (iPhoneX). This happens randomly, possibly triggered by user interaction with the DOM, but not always.
I've tested on my own iPhone6S with iOS 12 and haven't reproduced it, so I wonder if it's specific to iPhoneX + iOS 12.
Users don't have a crash report for the app, which makes me think it's the WebView reloading the page (it's a single page app), rather than an actual app crash.
This doesn't happen on any other device or iOS version - has anyone else experienced this or have a solution?
Here is the main section of my Cordova config.xml:
<content src="index.html" />
<preference name="BackupWebStorage" value="local" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="KeepRunning" value="false" />
<preference name="Fullscreen" value="true" />
<platform name="android">
<allow-intent href="market:*" />
<icon density="ldpi" src="res/android/ldpi.png" />
<icon density="mdpi" src="res/android/mdpi.png" />
<icon density="hdpi" src="res/android/hdpi.png" />
<icon density="xhdpi" src="res/android/xhdpi.png" />
<icon density="xxhdpi" src="res/android/xxhdpi.png" />
<icon density="xxxhdpi" src="res/android/xxxhdpi.png" />
<splash density="land-hdpi" src="res/screen/android/drawable-land-hdpi.png" />
<splash density="land-ldpi" src="res/screen/android/drawable-land-ldpi.png" />
<splash density="land-mdpi" src="res/screen/android/drawable-land-mdpi.png" />
<splash density="land-xhdpi" src="res/screen/android/drawable-land-xhdpi.png" />
<splash density="land-xxhdpi" src="res/screen/android/drawable-land-xxhdpi.png" />
<splash density="land-xxxhdpi" src="res/screen/android/drawable-land-xxxhdpi.png" />
<splash density="port-hdpi" src="res/screen/android/drawable-port-hdpi.png" />
<splash density="port-ldpi" src="res/screen/android/drawable-port-ldpi.png" />
<splash density="port-mdpi" src="res/screen/android/drawable-port-mdpi.png" />
<splash density="port-xhdpi" src="res/screen/android/drawable-port-xhdpi.png" />
<splash density="port-xxhdpi" src="res/screen/android/drawable-port-xxhdpi.png" />
<splash density="port-xxxhdpi" src="res/screen/android/drawable-port-xxxhdpi.png" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<icon height="180" src="res/ios/icon-60#3x.png" width="180" />
<icon height="60" src="res/ios/icon-60.png" width="60" />
<icon height="120" src="res/ios/icon-60#2x.png" width="120" />
<icon height="76" src="res/ios/icon-76.png" width="76" />
<icon height="152" src="res/ios/icon-76#2x.png" width="152" />
<icon height="40" src="res/ios/icon-40.png" width="40" />
<icon height="80" src="res/ios/icon-40#2x.png" width="80" />
<icon height="57" src="res/ios/icon.png" width="57" />
<icon height="114" src="res/ios/icon#2x.png" width="114" />
<icon height="72" src="res/ios/icon-72.png" width="72" />
<icon height="144" src="res/ios/icon-72#2x.png" width="144" />
<icon height="167" src="res/ios/icon-167.png" width="167" />
<icon height="29" src="res/ios/icon-small.png" width="29" />
<icon height="58" src="res/ios/icon-small#2x.png" width="58" />
<icon height="50" src="res/ios/icon-50.png" width="50" />
<icon height="100" src="res/ios/icon-50#2x.png" width="100" />
<icon height="167" src="res/ios/icon-83.5#2x.png" width="167" />
<splash src="res/screen/ios/Default#2x~universal~anyany.png" />
</platform>
<plugin name="cordova-plugin-file" spec="^5.0.0" />
<plugin name="cordova-plugin-ionic-webview" spec="^1.1.14" />
<plugin name="cordova-plugin-splashscreen" spec="^4.1.0" />
<plugin name="cordova-plugin-statusbar" spec="^2.2.2" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
<plugin name="cordova-plugin-screen-orientation" spec="^3.0.1" />
<engine name="ios" spec="^4.4.0" />
We also hit this issue with our Cordova app, and it took us ages to solve.
After recently switching to wkwebview, a file uploader page in the app started reloading often before the file uploads completed. It only happened for users with iPhone X & iOS 12. In our case, changing a Bootstrap spinner control resolved things. Seems crazy... but once we modified the component, the problem went away.

Ionic can't find platform

What is wrong with my config files (OR ionic cordova setup); it can't find any platforms but I do have ios installed already, PLUS ionic tries to add and fails because it exists... The example below is from emulate, the same errors are generated by $ionic cordova platform add ios as well.
$ ionic cordova emulate ios
> cordova platform add ios --save
✖ Running command - failed!
[WARN] Platform already added. Saving platforms to config.xml.
> cordova platform save
✔ Running command - done!
[INFO] Running app-scripts build: --platform ios --target cordova
[22:44:34] build dev started ...
[22:44:34] clean started ...
[22:44:34] clean finished in 11 ms
[22:44:34] copy started ...
[22:44:34] transpile started ...
[22:44:38] transpile finished in 4.45 s
[22:44:38] preprocess started ...
[22:44:38] deeplinks started ...
[22:44:39] deeplinks finished in 264 ms
[22:44:39] preprocess finished in 265 ms
[22:44:39] webpack started ...
[22:44:39] copy finished in 4.89 s
[22:44:50] webpack finished in 11.63 s
[22:44:50] sass started ...
[22:44:51] sass finished in 1.04 s
[22:44:51] postprocess started ...
[22:44:51] removed unused font files
[22:44:51] postprocess finished in 10 ms
[22:44:51] lint started ...
[22:44:51] build dev finished in 17.47 s
> ionic cordova prepare
[WARN] No Cordova platforms listed in config.xml. Nothing to prepare.
You can save your installed platforms to config.xml with the ionic cordova platform save command.
[22:44:53] lint finished in 2.11 s
And this is my config.xml file:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.nkt.pms" version="2.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Sys</name>
<description>System</description>
<author email="support#XXXX.net" href="http://XXXX">The XXXX Team</author>
<content src="index.html" />
<access origin="*" />
<allow-navigation href="http://ionic.local/*" />
<allow-navigation href="http://XXXX:8100" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="AndroidLaunchMode" value="singleTask" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="orientation" value="portrait" />
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
<icon height="114" src="resources/ios/icon/icon#2x.png" width="114" />
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
<icon height="80" src="resources/ios/icon/icon-40#2x.png" width="80" />
<icon height="120" src="resources/ios/icon/icon-40#3x.png" width="120" />
<icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
<icon height="100" src="resources/ios/icon/icon-50#2x.png" width="100" />
<icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
<icon height="120" src="resources/ios/icon/icon-60#2x.png" width="120" />
<icon height="180" src="resources/ios/icon/icon-60#3x.png" width="180" />
<icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
<icon height="144" src="resources/ios/icon/icon-72#2x.png" width="144" />
<icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
<icon height="152" src="resources/ios/icon/icon-76#2x.png" width="152" />
<icon height="167" src="resources/ios/icon/icon-83.5#2x.png" width="167" />
<icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
<icon height="58" src="resources/ios/icon/icon-small#2x.png" width="58" />
<icon height="87" src="resources/ios/icon/icon-small#3x.png" width="87" />
<splash height="1136" src="resources/ios/splash/Default-568h#2x~iphone.png" width="640" />
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
<splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
<splash height="1536" src="resources/ios/splash/Default-Landscape#2x~ipad.png" width="2048" />
<splash height="2048" src="resources/ios/splash/Default-Landscape#~ipadpro.png" width="2732" />
<splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
<splash height="2048" src="resources/ios/splash/Default-Portrait#2x~ipad.png" width="1536" />
<splash height="2732" src="resources/ios/splash/Default-Portrait#~ipadpro.png" width="2048" />
<splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
<splash height="960" src="resources/ios/splash/Default#2x~iphone.png" width="640" />
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
</platform>
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<icon src="resources/newicon.png" />
<icon src="resources/android/icon/drawable-xhdpi-icon.png" />
<plugin name="cordova-plugin-camera" spec="~2.4.1">
<variable name="CAMERA_USAGE_DESCRIPTION" value=" " />
<variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value=" " />
</plugin>
<plugin name="cordova-plugin-console" spec="^1.1.0" />
<plugin name="cordova-plugin-customurlscheme" spec="^4.3.0">
<variable name="URL_SCHEME" value="com.nkt.pms" />
<variable name="ANDROID_SCHEME" value="com.nkt.pms" />
<variable name="ANDROID_HOST" value="pmsys.eu.auth0.com" />
<variable name="ANDROID_PATHPREFIX" value="/cordova/com.nkt.pms/callback" />
</plugin>
<plugin name="cordova-plugin-device" spec="^1.1.6" />
<plugin name="cordova-plugin-file" spec="~4.3.3" />
<plugin name="cordova-plugin-file-transfer" spec="~1.6.3" />
<plugin name="cordova-plugin-filepath" spec="~1.0.2" />
<plugin name="cordova-plugin-safariviewcontroller" spec="^1.4.7" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-statusbar" spec="^2.2.3" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
<plugin name="cordova-sqlite-storage" spec="^2.0.4" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
$ ionic info
cli packages: (/Users/larsbrenna/Desktop/dev/app/node_modules)
#ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 7.0.1
local packages:
#ionic/app-scripts : 2.1.4
Cordova Platforms : ios
Ionic Framework : ionic-angular 3.7.1
System:
Node : v6.9.1
npm : 5.4.2
OS : macOS Sierra
Xcode : Xcode 9.0 Build version 9A235
Any and all tips and hints appreciated!!
Ionic can't find the platform because the <engine> tag is missing in config.xml. Try cleaning up your setup a bit:
Run cordova platform rm ios (you may get an error that the platform is not added)
Remove the platforms folder if it still exists
Maybe also remove the plugins folder if you want them reinstalled
Remove all references related to the ios platform in package.json
Delete node_modules and package-lock.json
Then make sure cordova and ionic CLIs are up to date:
(sudo) npm install -g cordova#latest ionic#latest
Then restore everything step by step:
npm install
cordova platform add ios#4.5.1
I personally like to run the cordova commands just through the cordova CLI not via the ionic CLI (when running ionic cordova ... the ionic CLI just forwards cordova related commands to the cordova CLI, which can lead to errors). Just for building and running the app I use the combined commands because its more convenient.
I also noticed that you are using an old version of #ionic/app-scripts with the newest ionic-angular version. You should upgrade this too.

Phonegap app works in phonegap app but not in phonegap build

I have an app that works 100% when running the phonegap windows program and then the phonegap app on my iphone.
However when I upload it to phonegap build then add the app to my phone via itunes the app is just a blank white screen.
Im using jquery mobile, socket.io and geolocation if any of that matters. Is it a whitelist issue?
What could be causing this?
I'm zipping the folder of my app that has a directory like this:
.cordova
hooks
platforms
plugins
www
config.xml
and here is my config file:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.phonegap.helloworld" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>test</name>
<description>Hello World sample application that responds to the deviceready event.</description>
<author email="support#phonegap.com" href="http://phonegap.com">PhoneGap Team</author>
<content src="index.html" />
<preference name="permissions" value="none" />
<preference name="orientation" value="default" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="true" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="14" />
<preference name="android-installLocation" value="auto" />
<gap:plugin name="org.apache.cordova.battery-status" />
<gap:plugin name="org.apache.cordova.camera" />
<gap:plugin name="org.apache.cordova.media-capture" />
<gap:plugin name="org.apache.cordova.console" />
<gap:plugin name="org.apache.cordova.contacts" />
<gap:plugin name="org.apache.cordova.device" />
<gap:plugin name="org.apache.cordova.device-motion" />
<gap:plugin name="org.apache.cordova.device-orientation" />
<gap:plugin name="org.apache.cordova.dialogs" />
<gap:plugin name="org.apache.cordova.file" />
<gap:plugin name="org.apache.cordova.file-transfer" />
<gap:plugin name="org.apache.cordova.geolocation" />
<gap:plugin name="org.apache.cordova.globalization" />
<gap:plugin name="org.apache.cordova.inappbrowser" />
<gap:plugin name="org.apache.cordova.media" />
<gap:plugin name="org.apache.cordova.network-information" />
<gap:plugin name="org.apache.cordova.splashscreen" />
<gap:plugin name="org.apache.cordova.vibration" />
<icon src="icon.png" />
<icon gap:platform="android" gap:qualifier="ldpi" src="www/res/icon/android/icon-36-ldpi.png" />
<icon gap:platform="android" gap:qualifier="mdpi" src="www/res/icon/android/icon-48-mdpi.png" />
<icon gap:platform="android" gap:qualifier="hdpi" src="www/res/icon/android/icon-72-hdpi.png" />
<icon gap:platform="android" gap:qualifier="xhdpi" src="www/res/icon/android/icon-96-xhdpi.png" />
<icon gap:platform="blackberry" src="www/res/icon/blackberry/icon-80.png" />
<icon gap:platform="blackberry" gap:state="hover" src="www/res/icon/blackberry/icon-80.png" />
<icon gap:platform="ios" height="57" src="www/res/icon/ios/icon-57.png" width="57" />
<icon gap:platform="ios" height="72" src="www/res/icon/ios/icon-72.png" width="72" />
<icon gap:platform="ios" height="114" src="www/res/icon/ios/icon-57-2x.png" width="114" />
<icon gap:platform="ios" height="144" src="www/res/icon/ios/icon-72-2x.png" width="144" />
<icon gap:platform="webos" src="www/res/icon/webos/icon-64.png" />
<icon gap:platform="winphone" src="www/res/icon/windows-phone/icon-48.png" />
<icon gap:platform="winphone" gap:role="background" src="www/res/icon/windows-phone/icon-173-tile.png" />
<gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="www/res/screen/android/screen-ldpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="www/res/screen/android/screen-mdpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="www/res/screen/android/screen-hdpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="www/res/screen/android/screen-xhdpi-portrait.png" />
<gap:splash gap:platform="blackberry" src="www/res/screen/blackberry/screen-225.png" />
<gap:splash gap:platform="ios" height="480" src="www/res/screen/ios/screen-iphone-portrait.png" width="320" />
<gap:splash gap:platform="ios" height="960" src="www/res/screen/ios/screen-iphone-portrait-2x.png" width="640" />
<gap:splash gap:platform="ios" height="1136" src="www/res/screen/ios/screen-iphone-portrait-568h-2x.png" width="640" />
<gap:splash gap:platform="ios" height="1024" src="www/res/screen/ios/screen-ipad-portrait.png" width="768" />
<gap:splash gap:platform="ios" height="768" src="www/res/screen/ios/screen-ipad-landscape.png" width="1024" />
<gap:splash gap:platform="winphone" src="www/res/screen/windows-phone/screen-portrait.jpg" />
<access origin="*" />
<plugin name="cordova-plugin-whitelist" version="1" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<engine name="ios" spec="~3.9.2" />
</widget>
Canned Message
I need to blog this, so i don't have to repeat this answer again and again.
You cannot use Phonegap Desktop App with Phonegap Build.
Phonegap Desktop App uses Phonegap CLI, so if you want to use Phonegap Desktop App you need to stay with Phonegap CLI.
If you want to use Phonegap Build, then forget what you have done and start over OR make Minor modifications to move Phonegap Desktop App to Phonegap Build. To be clear, the difference is minor, but enough to keep tripping you.
Also, you will not be able to use Phonegap Developer App as that is meant to work with Phonegap Desktop App. You cannot use either CLI or Build with Developer App.
FWIW: I've been trying to get Phonegap to fix this. Here is the report on the issue.
Here are the minor modifcations:
For Phonegap Build, index.html and config.xml both sit in the root directory and there is no www/ directory. No other items are required, and infact you want to remove anything not list in index.html before uploading to build.phonegap.com.
For Cordova/Phonegap CLI, config.xml is in the root directory and index.html sits in the www/ directory

<access origin="http://*" launch-external="yes" /> not working for iOS

launch-external does not seems to work for iOS. but it works perfectly for android.
I am looking for a 'launch-external' equivalent for iOS, i am using cardova (version 3.7.0) and phoneGap online build tool.
below is my config.xml
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="com.something.something" version="1.0.3">
<name>something</name>
<description>
something
</description>
<author href="http://something.com" email="something#something.com">Something</author>
<content src="index.html"/>
<preference name="permissions" value="none"/>
<preference name="orientation" value="default"/>
<preference name="target-device" value="universal"/>
<preference name="fullscreen" value="false"/>
<preference name="webviewbounce" value="false"/>
<preference name="prerendered-icon" value="true"/>
<preference name="stay-in-webview" value="false"/>
<preference name="ios-statusbarstyle" value="black-opaque"/>
<preference name="detect-data-types" value="true"/>
<preference name="exit-on-suspend" value="true"/>
<preference name="show-splash-screen-spinner" value="true"/>
<preference name="auto-hide-splash-screen" value="true"/>
<preference name="disable-cursor" value="false"/>
<preference name="android-minSdkVersion" value="7"/>
<preference name="android-installLocation" value="auto"/>
<preference name="DisallowOverscroll" value="true" />
<gap:plugin name="org.apache.cordova.console"/>
<gap:plugin name="org.apache.cordova.device"/>
<gap:plugin name="org.apache.cordova.dialogs"/>
<gap:plugin name="org.apache.cordova.geolocation"/>
<gap:plugin name="org.apache.cordova.globalization"/>
<gap:plugin name="org.apache.cordova.inappbrowser"/>
<gap:plugin name="org.apache.cordova.network-information"/>
<gap:plugin name="org.apache.cordova.vibration"/>
<gap:plugin name="org.apache.cordova.statusbar"/>
<gap:plugin name="org.apache.cordova.splashscreen"/>
<icon src="icon.png"/>
<icon src="res/icon/android/icon-36-ldpi.png" gap:platform="android" gap:qualifier="ldpi"/>
<icon src="res/icon/android/icon-48-mdpi.png" gap:platform="android" gap:qualifier="mdpi"/>
<icon src="res/icon/android/icon-72-hdpi.png" gap:platform="android" gap:qualifier="hdpi"/>
<icon src="res/icon/android/icon-96-xhdpi.png" gap:platform="android" gap:qualifier="xhdpi"/>
<icon src="res/icon/ios/icon-57.png" gap:platform="ios" width="57" height="57"/>
<icon src="res/icon/ios/icon-72.png" gap:platform="ios" width="72" height="72"/>
<icon src="res/icon/ios/icon-57-2x.png" gap:platform="ios" width="114" height="114"/>
<icon src="res/icon/ios/icon-72-2x.png" gap:platform="ios" width="144" height="144"/>
<!-- iPhone 6 / 6+ -->
<icon src="res/icon/ios/icon-60#3x.png" gap:platform="ios" width="180" height="180" />
<!-- iPhone / iPod Touch -->
<icon src="res/icon/ios/icon-60.png" gap:platform="ios" width="60" height="60" />
<icon src="res/icon/ios/icon-60#2x.png" gap:platform="ios" width="120" height="120" />
<!-- iPad -->
<icon src="res/icon/ios/icon-76.png" gap:platform="ios" width="76" height="76" />
<icon src="res/icon/ios/icon-76#2x.png" gap:platform="ios" width="152" height="152" />
<!-- Settings Icon -->
<!--
<icon src="res/icon/ios/icon-small.png" gap:platform="ios" width="29" height="29" />
<icon src="res/icon/ios/icon-small#2x.png" gap:platform="ios" width="58" height="58" />
-->
<!-- Spotlight Icon -->
<!--
<icon src="res/icon/ios/icon-40.png" gap:platform="ios" width="40" height="40" />
<icon src="res/icon/ios/icon-40#2x.png" gap:platform="ios" width="80" height="80" />
-->
<platform name="ios">
<!-- images are determined by width and height. The following are supported -->
<splash src="res/screen/ios/Default~iphone.png" width="320" height="480"/>
<splash src="res/screen/ios/Default#2x~iphone.png" width="640" height="960"/>
<splash src="res/screen/ios/Default-Portrait~ipad.png" width="768" height="1024"/>
<splash src="res/screen/ios/Default-Landscape~ipad.png" width="1024" height="768"/>
<splash src="res/screen/ios/Default-568h#2x~iphone.png" width="640" height="1136"/>
</platform>
<access origin="sms:*" launch-external="yes" />
<access origin="geo:*" launch-external="yes" />
<access origin="mailto:*" launch-external="yes" />
<access origin="tel:*" launch-external="yes" />
<access origin="http://*" launch-external="yes" />
<plugin name="cordova-plugin-whitelist"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<platform name="android">
<allow-intent href="market:*"/>
</platform>
<platform name="ios">
<allow-intent href="itms:*"/>
<allow-intent href="itms-apps:*"/>
</platform>
</widget>
I am using location.href in index.html to open the url in separte browser. This is working in Android as expected but not in iOS
In the documentation, launch-external is only mentioned in the Android section. That's probably why it doesn't work for iOS.
As an alternative, you could use the InAppBrowser plugin (don't be fooled by its name) to open certain links externally, but this requires you to rewrite those links to window.open calls, with the target parameter set to _system.
I tried all of these suggestions in a recent iOS build and the only thing that worked for me was the InAppBrowser plugin and changing the code to window.open(href,"_system");

Resources