iPhone and PhoneGap? Don't work

Get help using Construct 2

Post » Mon Apr 02, 2012 3:01 pm

After hours upon hours of testing I can say that c2 DOESN'T work on the iPhone with the latest phoneGap (1.5.0).

On the simulator it works perfectly, once built and sent to the device it does not, and it's a construct problem, it looks (say it looks because it's IMPOSSIBLE TO DEBUG) like something throws an error and the screen remains blank. I tried to remove any reference to c2 and the "Your browser doesn't..." string appears perfectly (so no memory problem as all the assets are still in the app.

Someone has any idea about this? @Ashley, how do I debug c2? Possibly with some try catch blocks? Has someone been successful on testing ON the actual device (not on the simulator)?

Thanks
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Mon Apr 02, 2012 3:06 pm

have you tried not to include phonegap.js into the zip?Wishy2012-04-02 15:07:06
B
22
S
11
G
9
Posts: 133
Reputation: 6,572

Post » Mon Apr 02, 2012 3:50 pm

@Ashley I fixed it but I need your input. Basically c2 works perfectly, the problem is that this event:

document.addEventListener("deviceready", function () {},false};
Never fires! I tried also with true at the end after reading a question on stack overflow. But with no luck.

I ended up using jQuery .ready and everything works as expected. It's very strange nevertheless as the standard example of PhoneGap works perfectly with deviceready.

I hope I helped someone to avoid wasting 2 hours trying to figure out this thing.


B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Mon Apr 02, 2012 11:09 pm

Well, I finally got this, turns out I made a mistake.
The new phoneGap (renamed Cordova) has two different js, one for iOS and the other for Android which are not interchangable. Be careful when developing for both!
B
29
S
9
G
6
Posts: 525
Reputation: 8,294


Return to How do I....?

Who is online

Users browsing this forum: djcrazypants, marekmk and 6 guests