cordova.js on iOS not loading

277 views
Skip to first unread message

Gene

unread,
Jun 2, 2012, 1:09:29 AM6/2/12
to phonegap
Hello,

I have a application that loads cordova.js to use some notifications

<script type="text/javascript" charset="utf-8" src="js/
cordova-1.7.0.js"></script>

I load it with

document.addEventListener("deviceready", onDeviceReady, false);

The notification works on the Android build, but not on the iOS build
I tried putting that line in a function and calling it from the onLoad
event.

<body onload="onBodyLoad()">

The error on iOS is happening when trying to call

navigator.notification.confirm()

Our app was built with PhoneGap for iOS before cordova.js and this
notification were added. I was told that rebuilding would NOT be
necessary.

Any ideas would be gratefully accepted. (I would be happy to read any
documentation you recommend, too. I'm new to PhoneGap, and searching
hasn't solved this one for me yet.)

Thanks for reading.

Gene

unread,
Jun 2, 2012, 1:09:53 AM6/2/12
to phonegap

Giacomo Balli

unread,
Jun 3, 2012, 4:46:21 AM6/3/12
to phonegap
when updating the framework there are several potential issues.
Especially if you don't go throught the "full" reinstall.

First check the obvious: do you have cordova.js in your www directory
(rather than old phonegapXXX.js)?

However, I'm afraid that you need to do a full cordova install since
you are using new functionalities.

filmaj

unread,
Jun 4, 2012, 2:08:26 PM6/4/12
to phonegap
What is the error you get?

ristre...@gmail.com

unread,
Jun 4, 2012, 2:22:12 PM6/4/12
to phon...@googlegroups.com
On the line

navigator.notification.confirm()

It is something like

notification is not valid on undefined.

Not an exact quote. I wrapped the code is a try/catch js block, and
alerted the error, which was something like that. When PG loads
properly (for Android in this case), navigator is defined, and it all
works.

The only difference for the two is that I rebuilt the PhoneGap app for
Android (because I can - I run Linux, not a Mac.) I was intending to
rebuild the iPhone app, but I was told by others that wouldn't be
necessary. I'm trying to rebuild anyway with build.phonegap.com now,
to rule that out. It could be that the iPhone app was originally
built with something other then 7.1, which I haven't confirmed yet.
Perhaps that would cause this problem.

Thanks
Gene
> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com



--
DELETE THIS LINE
Reply all
Reply to author
Forward
0 new messages