I have successfully developed a Cordova app that performs excellently on Android. Now, I am looking to extend its reach by creating an iOS version of the app as well, which was one of the initial reasons for choosing Cordova. I won't delve into the details of code signing requirements and so forth.
However, I am encountering a major challenge with the iOS version of the app. The JavaScript seems to crash right from the beginning when running it on an iOS device.
The app functions properly only on the simulator (using xcode 8.3 and iPhone 4 simulator). On actual devices, the JavaScript becomes completely unresponsive. Even on simulators like iPhone 5 and above, nothing seems to work anymore.
I suspect that there may be some issues related to permissions required for running the code or possibly a problem with one of the plugins.
The Content-Security-Policy line in index.html looks like this:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'; frame-src *; worker-src *; ">
Below is the complete list of plugins being used. I am aware of the minor code adjustment needed for the sqllite plugin as described here, but even after trying it, the issue persists.
Please change your code line to var db = window.openDatabase("test.db", "1.0", "test", 20000); (this is for ios) instead of var db = window.sqlitePlugin.openDatabase("test.db", "1.0", "test", 20000); (this is for android)
List of plugins used in the app:
cordova-plugin-app-event 1.2.1 "Application Events"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-crosswalk-webview 2.3.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.1.7 "Device"
cordova-plugin-inappbrowser 1.7.2 "InAppBrowser"
cordova-plugin-insomnia 4.3.0 "Insomnia (prevent screen sleep)"
cordova-plugin-mauron85-background-geolocation 2.2.5 "CDVBackgroundGeoloc
cordova-plugin-network-information 1.2.1 "Network Information"
cordova-plugin-spinner 1.1.0 "Spinner Plugin"
cordova-plugin-splashscreen 4.1.0 "Splashscreen"
cordova-plugin-statusbar 2.3.1-dev "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 1.4.9 "Cordova sqlite storage plugin"
cordova.plugins.diagnostic.api-22 2.3.10-api-22 "Diagnostic"
de.appplant.cordova.plugin.local-notification 0.8.5 "LocalNotification"
I am struggling to debug the iOS version of the app. It's possible that the issue could be related to permissions, CSP settings, or simply a plugin that requires updating. Any insights or suggestions would be greatly appreciated!