I am currently working on developing a hybrid app that utilizes iOS as the native platform and Cordova-Phonegap for HTML support.
Upon launching the application for the first time, we encounter an issue where the JavaScript fails to load. Although we are able to receive a call to onDeviceReady
in the Cordova Plugin class, when attempting to invoke a JavaScript method using
webview.stringByEvaluatingJavaScriptFromString
, it does not execute properly upon initial launch.
The specific method in question is located in a file that has been linked within the head section of the HTML file. However, despite its reference, the method does not get triggered during the first launch. Surprisingly, if the application has already been launched and the method is called again through another function, it executes successfully.
The setup consists of a simple HTML page with references to JavaScript files containing various JavaScript and jQuery functions.
We are loading our HTML page by adding it as a subview to self.view using CDVViewController
If you have any suggestions or solutions for this particular issue, please advise. Thank you.