cordova.InAppBrowser does not open url with system browser - cordova-plugins

Cordova plugin InAppBrowser is opening with InAppBrowser even when I set it to '_system'
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
cordova.InAppBrowser.open('https://google.com', '_system')
}
it is opening as if it were _blank, that is, i't not using the system browser.
My specs:
I'm using cordova 10
My specs
Cordova Packages:
cli: 10.0.0
common: 4.0.2
create: 3.0.0
lib: 10.0.0
common: 4.0.2
fetch: 3.0.0
serve: 4.0.0
Project Installed Platforms:
android: 9.0.0
browser: null
Project Installed Plugins:
cordova-pdf-generator: 2.1.1
cordova-plugin-camera: 4.0.3
cordova-plugin-compat: 1.2.0
cordova-plugin-device: 2.0.3
cordova-plugin-email-composer: 0.8.15
cordova-plugin-file-transfer: 1.7.1
cordova-plugin-file: 6.0.1
cordova-plugin-geolocation: 2.4.3
cordova-plugin-inappbrowser: 3.2.0
cordova-plugin-is-debug: 1.0.0
cordova-plugin-mobile-ocr: 3.1.1
cordova-plugin-network-information: 2.0.2
cordova-plugin-screen-orientation: 3.0.2
cordova-plugin-simple-image-resizer: 0.1.1
cordova-plugin-splashscreen: 6.0.0
cordova-plugin-statusbar: 2.4.3
cordova-plugin-whitelist: 1.3.4
es6-promise-plugin: 4.2.2
info.protonet.imageresizer: 0.1.1
Environment:
OS: Ubuntu 18.04.5 LTS (linux 5.4.0-48-generic) x64
Node: v12.18.4
npm: 6.14.8
android Environment:
android:
*************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
Running /home/joao/Android/Sdk/tools/bin/avdmanager list target
Available Android targets:==============] 100% Fetch remote repository...
----------
id: 1 or "android-24"
Name: Android API 24
Type: Platform
API level: 24
Revision: 2
----------
id: 2 or "android-25"
Name: Android API 25
Type: Platform
API level: 25
Revision: 3
----------
id: 3 or "android-26"
Name: Android API 26
Type: Platform
API level: 26
Revision: 2
----------
id: 4 or "android-27"
Name: Android API 27
Type: Platform
API level: 27
Revision: 3
----------
id: 5 or "android-28"
Name: Android API 28
Type: Platform
API level: 28
Revision: 6
----------
id: 6 or "android-29"
Name: Android API 29
Type: Platform
API level: 29
Revision: 4
----------
id: 7 or "android-R"
Name: Android API 29, R preview (Preview)
Type: Platform
API level: R
Revision: 4
Project Setting Files:
config.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.form.parking.violation" version="2.5.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Denúncia Estacionamento</name>
<description>
Envio de queixa de estacionamento ilegal a autoridade competente
</description>
<author email="peao.exaltado#gmail.com" href="http://passeiolivre.org">
Caminhante
</author>
<content src="index.html"/>
<icon height="512" src="res/icon/universal/icon4_512x512_playstore.png" width="512"/>
<icon density="xhdpi" height="196" src="res/icon/universal/icon4_XHDPI_196x196_320dpi.png" width="196"/>
<icon density="xxxhdpi" height="192" src="res/icon/universal/icon4_XXXHDPI_192x192_640dpi.png" width="192"/>
<icon density="xxhdpi" height="144" src="res/icon/universal/icon4_XXHDPI_144x144_480dpi.png" width="144"/>
<icon density="hdpi" height="72" src="res/icon/universal/icon4_HDPI_72x72_240dpi.png" width="72"/>
<icon density="mdpi" height="48" src="res/icon/universal/icon4_MDPI_48x48_160dpi.png" width="48"/>
<access origin="*"/>
<allow-navigation href="*"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<preference name="windows-target-version" value="10.0"/>
<preference name="windows-phone-target-version" value="10.0"/>
<preference name="iosExtraFilesystems" value="library,library-nosync,documents,documents-nosync,cache,bundle"/>
<preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,assets"/>
<preference name="StatusBarOverlaysWebView" value="false"/>
<preference name="StatusBarBackgroundColor" value="#FFFFFF"/>
<preference name="StatusBarStyle" value="blacktranslucent"/>
<hook src="scripts/importNpmPackages.js" type="before_prepare"/>
<hook src="scripts/copyCredentials.js" type="before_prepare"/>
<platform name="android">
<preference name="android-minSdkVersion" value="22"/>
<preference name="android-targetSdkVersion" value="29"/>
<allow-intent href="market:*"/>
<icon height="512" src="res/icon/android/512.png" width="512"/>
<icon density="xhdpi" height="192" src="res/icon/android/192.png" width="192"/>
<icon density="xxxhdpi" height="192" src="res/icon/android/192.png" width="192"/>
<icon density="xxhdpi" height="144" src="res/icon/android/144.png" width="144"/>
<icon density="hdpi" height="72" src="res/icon/android/72.png" width="72"/>
<icon density="mdpi" height="48" src="res/icon/android/48.png" width="48"/>
<splash density="hdpi" src="res/screen/android/screen-hdpi-portrait.png"/>
<splash density="port-hdpi" src="res/screen/android/screen-hdpi-portrait.png"/>
<splash density="ldpi" src="res/screen/android/screen-ldpi-portrait.png"/>
<splash density="port-ldpi" src="res/screen/android/screen-ldpi-portrait.png"/>
<splash density="mdpi" src="res/screen/android/screen-mdpi-portrait.png"/>
<splash density="port-mdpi" src="res/screen/android/screen-mdpi-portrait.png"/>
<splash density="xhdpi" src="res/screen/android/screen-xhdpi-portrait.png"/>
<splash density="port-xhdpi" src="res/screen/android/screen-xhdpi-portrait.png"/>
<hook src="scripts/minifyFiles.js" type="after_prepare"/>
</platform>
<platform name="ios">
<allow-intent href="itms:*"/>
<allow-intent href="itms-apps:*"/>
</platform>
</widget>
package.json:
--- Start of Cordova JSON Snippet ---
{
"plugins": {
"cordova-plugin-geolocation": {},
"cordova-plugin-email-composer": {},
"info.protonet.imageresizer": {},
"cordova-plugin-simple-image-resizer": {
"ANDROID_EXIFINTERFACES_VERSION": "27.+"
},
"cordova-plugin-camera": {},
"cordova-plugin-file-transfer": {},
"cordova-plugin-file": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-screen-orientation": {},
"cordova-plugin-device": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-network-information": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-mobile-ocr": {},
"cordova-plugin-compat": {},
"cordova-pdf-generator": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-is-debug": {}
},
"platforms": [
"browser",
"android"
]
}
--- End of Cordova JSON Snippet ---

try to use wkwebview
cordova.InAppBrowser.open(link, '_blank', 'usewkwebview=yes');

Related

Cordova UIWebView APIs Deprecated API Usage

I am kind of confused because I am still getting the ITMS-90809: Deprecated API Usage warning when I uploaded on the App Store. I have already upgraded my cordova-ios platform to version 5.1.1 as well as my the InAppBrowser to version 3.2.0
Here are my plugin list:
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-inappbrowser 3.2.0 "InAppBrowser"
cordova-plugin-keyboard 1.2.0 "Keyboard"
cordova-plugin-screen-orientation 3.0.1 "Screen Orientation"
cordova-plugin-statusbar 2.4.3-dev "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-wkwebview-engine 1.1.4 "Cordova WKWebView Engine"
cordova.plugins.diagnostic 5.0.1 "Diagnostic"
And I have added WKWebViewOnly in the config.xml. Here is the config.xml for ios
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<icon height="57" src="res/icon/ios/icon-57.png" width="57" />
<icon height="114" src="res/icon/ios/icon-57-2x.png" width="114" />
<icon height="57" src="res/icon/ios/icon-72.png" width="57" />
<icon height="144" src="res/icon/ios/icon-72-2x.png" width="144" />
<icon height="1024" src="res/icon/ios/Icon-1024.png" width="1024" />
<preference name="Orientation" value="portrait" />
<preference name="KeyboardShrinksView" value="false" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVUIWebViewEngine" />
<preference name="WKWebViewOnly" value="true" />
</platform>
I am not sure what I've got wrong.
Can you check in your xcode console what is loading WkWebwiew or UIWebview.
2 Things here,
Did you upgrade to WKWebView by using
ionic cordova plugin add cordova-plugin-ionic-webview --save
CordovaWebViewEngine should have the value CDVWKWebViewEngine
The issue is with the inappbrowser plugin you may need to update it to the latest.

ionic cordova run ios - Export failed with code 65

I'm done with research on this error. I get following error when trying to run ionic cordova run ios --livereload:
[cordova] Non-system Ruby in use. This may cause packaging to fail.
[cordova] If you use RVM, please run `rvm use system`.
[cordova] If you use chruby, please run `chruby system`.
[cordova] error: archive not found at path '/Users/yassinezeriouh/Desktop/doday2/platforms/ios/DoDay.xcarchive'
[cordova] ** EXPORT FAILED **
[cordova]
[cordova] CordovaError: Promise rejected with non-error: 'Error code 65 for command: xcodebuild with args: -exportArchive,-archivePath,DoDay.xcarchive,-exportOptionsPlist,/Users/yassinezeriouh/Desktop/doday2/platforms/ios/exportOptions.plist,-exportPath,/Users/yassinezeriouh/Desktop/doday2/platforms/ios/build/device,-allowProvisioningUpdates'
re-installed ios
downgraded ios
all signing is correct in xcode
tried with custom build.json
re-installed all plugins
Running the project in xcode on my device works perfectly, tried to fix this issue since 4 hours, hope you can help.
I'm running iOS 12, using Xcode 10.1, cordova 8.1.2, ionic 4.40 (project is actually running on ionic v3 and was created last month)
My config.xml (except android & ios splash/icon section):
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.zeriouh.censored" version="1.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Censored</name>
<description>Censored</description>
<author email="cen#so.red" href="http://ce.nsor.ed/">Yassine Zeriouh</author>
<content src="index.html" />
<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="ScrollEnabled" value="false" />
<preference name="android-minSdkVersion" value="19" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="false" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="100" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<engine name="android" spec="6.3.0" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
<plugin name="cordova-plugin-device" spec="^2.0.2" />
<plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
<plugin name="cordova-plugin-ionic-webview" spec="^2.2.0">
<variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
</plugin>
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.3" />
<plugin name="cordova-plugin-inapppurchase" spec="~1.2.0" />
<plugin name="com.omarben.inappreview" spec="~0.0.6" />
<plugin name="cordova-plugin-admob-free" spec="~0.22.0" />
<plugin name="cordova-plugin-email-composer" spec="~0.8.15" />
<plugin name="cordova-plugin-local-notification" spec="~0.9.0-beta.2" />
<plugin name="cordova-plugin-badge" spec="~0.8.7" />
<plugin name="cordova-plugin-apprate" spec="~1.4.0" />
<engine name="ios" spec="~4.5.5" />
</widget>
try this beacuse the xcode 10.1 build in a diferent way to the ionic 3 now
ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0" --livereload
There is an issue with "cordova-ios": "4.5.5".
Try following below steps.
ionic cordova platform rm ios
npm uninstall cordova-ios
npm install cordova-ios#4.4.0
ionic cordova platform add ios#4.4.0
ionic cordova run ios --livereload
For me it worked after changing my cordova-ios version from 4.5.5 to 4.4.0.
in package.json I changed "cordova-ios": "4.5.5" to "cordova-ios": "4.4.0"
in config.xml I changed <engine name="ios" spec="4.5.5" /> to <engine name="ios" spec="4.4.0" />
rm -rf node_modules/ platforms/ios/
npm i
ionic cordova build ios
I have the same problem when I'm building for ios with "prod" tag.
I have:
MacOS catalina 10.5.4
Xcode version 12.2
cordova-ios 6.0.0
For me the solution that worked was first sign the app on xcode after the first build issue (open platform/ios with xcode and sign the app). Then I build with the commands that people suggest here, but I have to add the "--device" tag also. After that work good :)
ionic cordova run ios --prod --release --buildFlag="-UseModernBuildSystem=0" --device

Cordova Ionic project with Firebase Messaging and Firebase Dynamic Links

In the app that we're building, we need Firebase Dynamic Link, because the Sign Up is with Firebase email link login. This login will send an email to the provided email address, that when clicked, will open the app with a dynamic link. To keep our users engaged, we also like to send Push Notifications. I can get both of them to work together on Android when I use the versions by chemerisuk on GitHub. I even get an iOS build, but I get stuck on getting a token on iOS. Getting this error message:
Failed to fetch default token Error Domain=com.firebase.iid Code=1003 "(null)"
I've double checked my Firebase Project settings (bundle id, app id prefix, cloud messaging sender id, cloud messaging apn key) and my Apple settings (certificates, provisioning profiles, keys and identifiers). I've tried it on Simulators and Real Devices. I've tried Development builds, App Store Archives and Ad Hoc Archives.
Unfortunately, Dynamic Links isn't included in the Cordova Firebase plugin. When I try to add a different fcm plugin, it includes the complete Firebase Core, which conflicts with Dynamic Links.
I feel like I'm really close, who has any experience with this combination of plugins and got it working on iOS?
This is my environment:
Ionic:
ionic (Ionic CLI) : 4.0.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.1.8
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0, ios 4.5.5
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
ios-sim : 6.1.2
NodeJS : v8.11.3 (/usr/local/bin/node)
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 9.4.1 Build version 9F2000
Environment:
ANDROID_HOME : /Users/user/Library/Android/sdk/
My (relevant) Cordova config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget android-packageName="com.example.android" android-versionCode="10001" id="com.example.app" ios-CFBundleIdentifier="com.example.ios" ios-CFBundleVersion="1.0.1" version="1.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Example</name>
<description>Some description</description>
<content src="index.html" />
<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="ScrollEnabled" value="false" />
<preference name="BackgroundColor" value="0xff168aa5" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="Orientation" value="portrait" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<platform name="android">
<resource-file src="google-services.json" target="app/google-services.json" />
<allow-intent href="market:*" />
<icon />
<splash />
</platform>
<platform name="ios">
<resource-file src="GoogleService-Info.plist" />
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<icon />
<splash />
</platform>
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
<plugin name="cordova-plugin-device" spec="^2.0.2" />
<plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
<plugin name="cordova-plugin-ionic-webview" spec="^1.2.1" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.2" />
<plugin name="cordova-plugin-x-socialsharing" spec="^5.4.1" />
<plugin name="cordova-plugin-qrscanner" spec="^2.6.0" />
<allow-navigation href="http://192.168.178.19:8101" />
<plugin name="cordova-plugin-firebase-dynamiclinks" spec="^1.0.0">
<variable name="APP_DOMAIN" value="example.com" />
<variable name="PAGE_LINK_DOMAIN" value="ab123.app.goo.gl" />
<variable name="FIREBASE_DYNAMIC_LINKS_VERSION" value="+" />
</plugin>
<plugin name="cordova-plugin-firebase-messaging" spec="^1.1.0">
<variable name="FIREBASE_MESSAGING_VERSION" value="17.1.+" />
<variable name="ANDROID_SUPPORT_VERSION" value="27.+" />
</plugin>
<engine name="android" spec="7.0.0" />
<engine name="ios" spec="4.5.5" />
</widget>
Because I was using only parts of the Firebase library, I didn't include Firebase Analytics, because I wasn't using it. Apparently, it's necessary for the functioning of the rest of the plugins. So installing cordova-plugin-firebase-analytics was the fix for me.
For some, it was making sure that they had the correct Firebase project settings. Go to Firebase > Cloud messaging > iOS app configuration and make sure you've uploaded a valid APNs Authentication Key or APNs Certificates.
Hope this helps other people who want to use both Firebase Messaging AND Firebase Dynamic Links!

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.

Ionic2 IOS failed while android OK

I'm building an application with Ionic2 cordova.
I don't understand why the application is running fine on Chrome (ionic serve) and android (ionic run android) while it's not on safari (ionic serve) and xcode emulator (ionic run ios).
The application launches the splashscreen on xcode emulator then stays blank.
Here is my ionic info:
Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0-beta.37
Ionic App Lib Version: 2.0.0-beta.20
ios-deploy version: Not installed
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v6.2.2
Xcode version: Xcode 7.3 Build version 7D175
I opened the project on xcode, and here is the errors I get:
2016-08-21 17:59:30.175 Woocommerce Mobile[70183:8564273] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/GM/Library/Developer/CoreSimulator/Devices/3DEADFD6-D4D5-437C-9DBA-2FC8D02DA537/data/Containers/Data/Application/C7FE4875-2781-4FC8-9B68-AA6E1F8BCA7D/Library/Cookies/com.yin.woocommerce.binarycookies
2016-08-21 17:59:30.221 Woocommerce Mobile[70183:8564273] Apache Cordova native platform version 4.1.1 is starting.
2016-08-21 17:59:30.222 Woocommerce Mobile[70183:8564273] Multi-tasking -> Device: YES, App: YES
2016-08-21 17:59:30.273 Woocommerce Mobile[70183:8564273] CDVWKWebViewEngine: trying to inject XHR polyfill
2016-08-21 17:59:30.277 Woocommerce Mobile[70183:8564273] CDVWKWebViewEngine will reload WKWebView if required on resume
2016-08-21 17:59:30.277 Woocommerce Mobile[70183:8564273] Using WKWebView
2016-08-21 17:59:30.278 Woocommerce Mobile[70183:8564273] [CDVTimer][handleopenurl] 0.079989ms
2016-08-21 17:59:30.280 Woocommerce Mobile[70183:8564273] [CDVTimer][intentandnavigationfilter] 1.766980ms
2016-08-21 17:59:30.280 Woocommerce Mobile[70183:8564273] [CDVTimer][gesturehandler] 0.063002ms
2016-08-21 17:59:30.280 Woocommerce Mobile[70183:8564273] CDVPlugin class CDVSplashScreen (pluginName: splashscreen) does not exist.
2016-08-21 17:59:30.280 Woocommerce Mobile[70183:8564273] [CDVTimer][splashscreen] 0.165999ms
2016-08-21 17:59:30.280 Woocommerce Mobile[70183:8564273] CDVPlugin class IonicKeyboard (pluginName: keyboard) does not exist.
2016-08-21 17:59:30.280 Woocommerce Mobile[70183:8564273] [CDVTimer][keyboard] 0.117004ms
2016-08-21 17:59:30.281 Woocommerce Mobile[70183:8564273] CDVPlugin class CDVStatusBar (pluginName: statusbar) does not exist.
2016-08-21 17:59:30.296 Woocommerce Mobile[70183:8564273] [CDVTimer][statusbar] 15.504956ms
2016-08-21 17:59:30.296 Woocommerce Mobile[70183:8564273] [CDVTimer][TotalPluginStartup] 18.702984ms
2016-08-21 17:59:30.719 Woocommerce Mobile[70183:8564273] CDVPlugin class CDVDevice (pluginName: Device) does not exist.
2016-08-21 17:59:30.720 Woocommerce Mobile[70183:8564273] ERROR: Plugin 'Device' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2016-08-21 17:59:30.720 Woocommerce Mobile[70183:8564273] FAILED pluginJSON = ["Device1663822631","Device","getDeviceInfo",[]]
2016-08-21 17:59:30.721 Woocommerce Mobile[70183:8564273] CDVPlugin class CDVStatusBar (pluginName: StatusBar) does not exist.
2016-08-21 17:59:30.721 Woocommerce Mobile[70183:8564273] ERROR: Plugin 'StatusBar' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2016-08-21 17:59:30.721 Woocommerce Mobile[70183:8564273] FAILED pluginJSON = ["StatusBar1663822632","StatusBar","_ready",[]]
2016-08-21 17:59:30.958 Woocommerce Mobile[70183:8564598] CDVWKWebViewEngine: XHR intercepted: build/app.html
And finally my config.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Woocommerce Mobile</name>
<description>Woocommerce Mobile Application</description>
<author email="" href="http://ionicframework.com/">Mobile Division</author>
<content src="index.html"/>
<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:*"/>
<platform name="android">
<allow-intent href="market:*"/>
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png"/>
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png"/>
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png"/>
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png"/>
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png"/>
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png"/>
<splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png"/>
<splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png"/>
<splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png"/>
<splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png"/>
<splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png"/>
<splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png"/>
<splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png"/>
<splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png"/>
<splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png"/>
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png"/>
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png"/>
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png"/>
</platform>
<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="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="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="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine"/>
</feature>
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar"/>
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine"/>
<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="SplashScreen" value="screen"/>
<preference name="SplashScreenDelay" value="2000"/>
<preference name="FadeSplashScreenDuration" value="2000"/>
<icon src="resources/android/icon/drawable-xhdpi-icon.png"/>
<plugin name="cordova-plugin-device" spec="~1.1.2"/>
<plugin name="cordova-plugin-console" spec="~1.0.3"/>
<plugin name="cordova-plugin-whitelist" spec="~1.2.2"/>
<plugin name="cordova-plugin-splashscreen" spec="~3.2.2"/>
<plugin name="ionic-plugin-keyboard" spec="~2.2.0"/>
<plugin name="cordova-plugin-statusbar" spec="~2.1.3"/>
<plugin name="cordova-plugin-wkwebview-engine" spec="https://github.com/driftyco/cordova-plugin-wkwebview-engine.git"/>
</widget>
Any idea why this is working fine on android and not on ios? Sorry for my noobness, this is all new for me...
Thanks.

Resources