iOS10 cordova-camera-roll crashes app - ios

Newest iOS 10.2, Phonegap build crashes with cordova-camera-roll version 0.2.1 plugin.
Using Phonegap version cli-6.3.0
<preference name="phonegap-version" value="cli-6.3.0" />

Looks like the new plugin cordova-plugin-ios-camera-permissions and cordova-plugin-ios-microphone-permissions solves the issue.
<plugin name="cordova-plugin-ios-camera-permissions" spec="1.0.3" />
https://www.npmjs.com/package/cordova-plugin-ios-camera-permissions
<plugin name="cordova-plugin-ios-microphone-permissions" spec="1.0.0" />
https://github.com/pinchnzoom/cordova-plugin-ios-microphone-permissions

Related

App stuck in white screen in iOS ionic 5 app

I pushed newly created ionic app to test flight and got bellow error.
ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).
Follow the below steps to Fix it.
1) Created new ionic app (Ionic version 5.0.0)
2) Added iOS platform (ionic cordova platfrom add ios#5.1.1)
3) After adding platform below plugins will get added to package.json & config.xml
Package.json :
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-ionic-webview": "^4.1.1",
Config.xml
<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-keyboard" spec="^2.0.5" />
<plugin name="cordova-plugin-ionic-webview" spec="^4.0.1">
4) Removed Webview plugin as suggested ionic Cordova plugin rm cordova-plugin-ionic-webview.
5) Removed platform ionic cordova platform rm ios
6) Added plugin cordova-plugin-wkwebview-engine#1.2.1 --save
7) Added preference attribute CordovaWebViewEngine to the config.xml as below.
8) Added feature attribute CDVWKWebViewEngine to the config.xml as below.
9) Added preference WKWebViewOnly to the config.xml as below.
"<platform name="ios">
<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
</platform>"
10) Added ios platform "ionic cordova platform add ios#5.1.1 --save"
11) Build project "ionic cordova build iOS"
12) Open project in XCode and try to launch app in Simulator and iPhone getting white screen after splash screen
Now app got stuck in white screen after splash screen, Please help me to resolve this issue.
Thanks
Anshul

App Store Connect ITMS-90809 error: Native iOS app developed with Cordova using CocoaPods

We are developing a native iOS app using Cordova and its plugins. We installed Cordova using CocoaPods.
The app is working fine in the simulators and real devices. But when we are uploading it to App Store Connect we are getting the following error:
ITMS-90809: Deprecated API Usage – Apple will stop accepting submissions of apps that use UIWebView APIs.
For the above issue we installed cordova-plugin-wkwebview-engine with CocoaPods. It is working fine in simulators but giving the same error during the upload.
So kindly help us to resolve this issue as soon as possible.
Have you tried to add the following in your config.xml in the iOS platform element?
<platform name="ios">
<preference name="WKWebViewOnly" value="true" />
</platform>
Add the following in config.xml under <platform name="ios">
<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
And make sure you're using Cordova iOS 5.1.1 or later

Phonegap Build: cordova-plugin-contacts not loading

I am facing issues with my contacts plugin for last few days. While building application using PGB the contacts plugin is getting listed under plugin tab. But, while doing chrome inspect for my App, it is not getting loaded under android_assets/www/plugins folder. Due to which while trying to create object ContactFindOptions() under deviceready() ,I am facing Uncaught ReferenceError. Can someone please help. I have tested this on Android 5.1.1 and 6.0.1
Below are the screenshots.
PGB Plugins tab
Chrome Inspect Error and folder structure
config.xml
<!-- Core plugins -->
<plugin name="cordova-plugin-contacts" source="npm" />
<plugin name="cordova-plugin-calendar" source="npm" />
<plugin name="cordova-plugin-device" source="npm" />
<plugin name="cordova-plugin-globalization" source="npm" />
<plugin name="cordova-plugin-dialogs" source="npm" />
<plugin name="phonegap-plugin-push" spec="1.4.5" source="npm">
<param name="SENDER_ID" value=“##########” />
</plugin>
Got the solution.
The error is shown in the PGB log. Here, the latest version of cordova-plugin-contacts (3.0.1) is not compatible with PGB version (cli-6.5.0 Android 6.1.2), so need to downgrade the plugin.
spec="2.3.1" of cordova-plugin-contacts is compatible with cli-6.5.o of PGB.

Cordova iOS Cross origin requests are only supported for HTTP

I'm building an iOS app and recently upgraded cordova-ios to 4.1.0 and started using: cordova-plugin-wkwebview-engine.
The problem is that now I get the error message Cross origin requests are only supported for HTTP while trying to load dependencies, so the app won't start.
It's trying to load systemjs dependencies over file://, but I included in my config.js.
I have no clue how to fix this. Does anyone have experience with this bevaviour?
cordova version: 6.1,0
cordova ios version: 4.1.0
related config.xml bit:
<access origin="*" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
Install this one plugin (cordova-ios 6+)
cordova plugin add https://github.com/globules-io/cordova-plugin-ios-xhr
then set
<preference name="AllowUntrustedCerts" value="true" />
<preference name="InterceptRemoteRequests" value="all" />
<preference name="allowFileAccessFromFileURLs" value="true" />
<preference name="allowUniversalAccessFromFileURLs" value="true" />
Install the following plugins:
cordova plugin add cordova-plugin-wkwebview-engine
cordova plugin add cordova-plugin-wkwebview-file-xhr
cordova plugin add https://github.com/TheMattRay/cordova-plugin-wkwebviewxhrfix
Add to config.xml:
<platform name="ios">
...
<preference name="WKWebViewOnly" value="true"/>
...
</platform>
For Cordova iOS 6+ just need to install the following plugin.
cordova plugin add https://github.com/AraHovakimyan/cordova-plugin-wkwebviewxhrfix
This plugin does not depend on any other additional plugins and does not require additional permissions.
I had the same issue with my cordova project (actually Ionic v1) and I fix it with the following command:
cordova plugin add https://github.com/apache/cordova-plugins.git#wkwebview-engine-localhost
This will install a webserver that runs locally and the error should be gone after that. After you run that command, just run:
cordova prepare ios
or remove all plugins and reinstall:
rm -rf plugins/
cordova platform add ios
Make sure you have this in your config.xml:
<access origin="*" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
If you work with cordova-ios ^6.0.0. you need only to modify your config.xml file:
<platform name="ios">
...
<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />
...
</platform>
No need to install any additional plugins.
See Cordova iOS 6.0.0 Released for more info.
I had the same issue with my ionic v1 Cordova project. For me the solution was to migrate to capacitor, like this:
Start a New Ionic v1 project (% ionic start Bienchen blank --type ionic1)
Answer "yes" when the cli asked if to integrate "capacitor".
Checkout my Sources to the www-folder of the new Ionic v1 project
Build the project with capacitor (% ionic capacitor build iOS)
Keep in mind the the Cordova config.xml than is not longer used, instead configure in Xcode Project.

Xcode PhoneGap navigator.connection Undefined

Trying to port my PhoneGap javascript code into Xcode for debugging in iOS.
Using Cordova-3.0.0.
When I call:
navigator.connection.type
I am getting an 'undefined' for navigator.connection.
Did I not include the network connection plugin correctly in my config.xml, or is something else amiss? Yes, I included the correct cordova.js file specifically for iOS. Yes, deviceready has been fired.
Update: I am currently only running this on the iOS emulator.
My config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.app.test" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Hello Cordova</name>
<description>
Description
</description>
<author email="dev#callback.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<access origin="*" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<plugins>
<plugin name="NetworkStatus" value="CDVConnection" />
</plugins>
</widget>
Thank you for your help!
Been doing my research on this one, and finally came up with the solution.
Apparently PhoneGap (Adobe) recently updated their documentation, and filled in a lot of the holes I was running into for Phonegap 3.0.0
1) To do this using the command-line interface, you have to have git installed to be able to run those commands. Get git here.
2) They added to the Connection plugin documentation to use the following command-line interface commands to add the plugin to the project:
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git
$ cordova plugin rm org.apache.cordova.core.network-information
3) They updated the declaration in the config.xml file to the following (for iOS):
<feature name="NetworkStatus">
<param name="ios-package" value="CDVConnection" />
</feature>
If you simply want to know if you are connected or not try using navigator.onLine in your js instead. Works for me on IOS 8 & Android 2.3 and doesn't require any plugins

Resources