PhoneGap onDeviceReady will not launch on iPhone

I have a PhoneGap application that will not fire the "deviceready" event on the iPhone, but will fire it on Android.

Any ideas why this is? or how to fix it?

(Phonegap ver 1.0)

The code:

function onBodyLoad() { if (typeof navigator.device == "undefined"){ document.addEventListener("deviceready", onDeviceReady, false); } else { onDeviceReady(); } } <body onload="onBodyLoad()"> 

Thanks!

+6
source share
1 answer

Have you just copied your www folder from one to another? Android and iOS use their own phonegap-1.0.0.js file. Make sure you use the correct js file for the platform.

+12
source

Source: https://habr.com/ru/post/895523/


All Articles