The iOS Cordova (PhoneGap) application is experiencing a complete blockage of its JavaScript code, causing it to

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!

Answer №1

If you're looking to debug an app on iOS, the process involves using Safari browsers and enabling the web inspector on your device through Settings -> Safari -> Advanced -> Web Inspector Enabled.

Next, navigate to Safari on your Mac and select your device from the develop menu. If you don't see the develop menu, go to Safari -> Preferences -> Advanced -> and check 'show develop in menu'.

Using the debugger should help you identify and resolve any issues you may encounter.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Bring to the front the div altered by a CSS3 animation

Recently, I encountered an issue with a div card that triggers an animation when clicked. The animation involves the card scaling up larger, but the problem arises as its edges get hidden under other cards. To visualize this, take a look at the screenshot ...

Utilizing SFAuthenticationSession for seamless login access to Microsoft Graph

I initially relied on the p2-oauth2 library to enable login through a safariViewController. However, after updating to the latest iOS version (11.3), I noticed that my app kept crashing whenever users tried to log in. Despite not receiving any error messag ...

Sending multiple ajax requests with identical data

I have been trying to send multiple requests to the same URL. The goal is to ban all the users that are included in the 'users' array by sending individual POST requests for each user. However, I am facing an issue where I keep getting the same d ...

Is it possible to automatically set focus on the input box in an html tag multiple times instead of just once with autofocus?

Currently, I am developing an online editor that allows users to quickly edit individual words. My approach involves replacing specific words with input boxes containing the word for direct editing by users. In order to streamline the process and ensure e ...

Is there a user-friendly method to transmit a lengthy combination string variable from JavaScript to a URL variable using the GET method?

Recently, I took over a project that involves a basic AJAX GET handler for simple name, value pairs of variables (e.g. ?type=new&id=4). However, now I am faced with the challenge of transmitting a paragraph-sized text string that may contain various sp ...

Leverage multiple registered helpers on a single page with Node JS

Currently running on my node js server is this code, which is using version 8.11.1. app.get('/parenting',(req,res)=>{ dbtools.getCategories().then((result)=>{ res.render('parenting.hbs',{result}); }).catch((err)=>{ r ...

Struggling to maintain data consistency among controllers in Angular by utilizing the rootScope, only to encounter persistent issues with

I am facing an issue with displaying the admin status at the top of all pages for a user who successfully logs in as an admin. Here is my code snippet: <!-- nav bar --> <div> <span ng-show="$root.isAdmin">(ADMIN)</span> </di ...

The batch request from localhost for the Google Calendar API has been rejected

When testing the Google Calendar API V3 by submitting a batch request from localhost, I am encountering the error message ""from origin 'http://localhost' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is ...

Is it possible to deactivate JavaScript for only a specific section of my HTML code?

Currently, I am utilizing a bootstrap template that incorporates the "jqBootstrapValidation.js" script for form validation. After customizing the template and adding a new form, I encountered an issue where my submit button was not functioning properly. Su ...

Struggling with a Bootstrap v5.0.2 Modal glitch? Let's dive into a real-life case study to troub

I am seeking assistance with a problem that I am encountering. I am currently using Bootstrap version 5.0.2 (js and css). Despite coding all the required parameters, I am unable to make the modal functionality work. I have been trying to figure out what&ap ...

Bring the arrayList back to its original form

[Closed] - Issue with Log.d revealing private members of the adapter class, causing changes in filtering function Note: [11.01.2017] The source code for RestInfoAdapter.java has been updated (Refer to item number 2 below) I've been attempting to rev ...

The removal of div elements with the jquery remove() property can sometimes exhibit unpredictable outcomes

I am facing an issue with deleting divs that contain checkboxes. The goal is to delete the div with the checked checkbox when the delete button is clicked. However, the deletion process seems to be unpredictable for me. You can check out my code in this JS ...

Populate a 2D array in JavaScript/NodeJS "line by line"

Hey there! I could really use some help with JavaScript/NodeJS arrays. Here is the code I'm working with: let arr = new Array(); arr = { "Username" : var1, "Console" : var2, "Pseudo" : var3, } console.log(arr); The variables var1, var2, ...

Tips for updating a div element while maintaining its style and select2 plugin functionality with jQuery

Within the HTML code, I am attempting to refresh the following div: <select name="test[]" id="test" multiple required class="select2"> @foreach($tests as $s) ...

Guide to shuffling an array with a simple click of a button

To simplify, I have an array that I would like to randomize by clicking a button. Once randomized, I want to display the first result from the array with another button. The array is currently randomized when opened in Chrome, and checking the results in t ...

How can I make the top two divs stay fixed as I scroll down, and then reset back to their initial position when scrolled

Hey there, I'm looking to have a div stay fixed after scrolling within its parent div. <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12"> <div class="fw ofndr-box"> <div class="ofndr-box-half add-here"> <a href="#! ...

Using additional properties when referencing another Mongoose schema

var UserSchema = new Schema({ job : [{ type : mongoose.Schema.Types.ObjectId, experience : String, grade : String, ref: 'Company'}] }); User's profile can include multiple jobs. The process of adding a job to the user is a ...

What steps should I take in modifying my existing code to use jQuery to set my div to a minimum height rather than a fixed height?

Could someone assist me in adjusting my div to have a min-height instead of a regular height? Whenever I click on the "Learn more" button, it extends past my div because the function is designed to set a specific height rather than an equal height. $.fn.e ...

What is the process for triggering a method upon the alteration of a global variable?

Apologies for the lack of code in my inquiry! I am looking to create a program that triggers gyroscope updates once the x-axis reading of the accelerometer surpasses a specific threshold value. Once the gyroscope is activated, I need to halt accelerometer ...

Expanding Logo on Mobile with Javascript

I'm encountering some difficulties with the site. When viewing it on a mobile device or resizing the browser to phone size, if you scroll down and then back up, the logo appears oversized. I want it to remain small like it was at the beginning (refres ...