Roman
Roman

Reputation: 4513

PhoneGap onDeviceReady won't fire up on iPhone

I've got a PhoneGap app that won't run the "deviceready" event on an iPhone but WILL run it on Android.

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

(PhoneGap ver 1.0)

The code is :

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

<body onload="onBodyLoad()">

Thanks!

Upvotes: 6

Views: 3196

Answers (1)

Devgeeks
Devgeeks

Reputation: 5647

Did you just copy your www folder from one to the other? Android and iOS use their own phonegap-1.0.0.js file. Make sure you are using the correct js file for the platform.

Upvotes: 12

Related Questions