I have an iPhone PhoneGap application. There is a HTML file located in a remote server, and another html file in the project bundle (local).
After upgrading to PhoneGap 2.1, my onDeviceReady() (listening to “deviceready”) method is not being called anymore, on the server side. I have a HTML file locally, and locally the method onDeviceReady is being called without any problems. But after being redirected to a web page application, the onDeviceReady() method is not being called anymore. I did not have this kind of issue using PhoneGap 2.0. Do someone have an idea why it might be so?
I have made a completelly new (template) PG Project, using the console, and added the www folder to my server. In the template project, I make a redirection to the index.html in the www remote folder, of the template phonegap project. I have realized, that the same problem always happen: the onDeviceLoad method is not being called. And that’s the template project from phonegap. Locally it works ok, but not when its on the server. My allowed ExternalHosts has been set to ‘*’ (all hosts allowed).
I have found out, that other developers have the same problem: https://issues.apache.org/jira/browse/CB-1529
Do someone know how to solve this problem? Thanks in advance.
The PhoneGap Developer Team has answered to my Jira Ticket, and their solution has solved my problem. Here is what they wrote (https://issues.apache.org/jira/browse/CB-1525):
To resolve this locally, change the following line in your cordova.js file:
execXhr.open(‘HEAD’, “file:///!gap_exec”, true);
To:
execXhr.open(‘HEAD’, “/!gap_exec”, true);