Friday, 15 March 2013

cordova - iOS notification.alert() not working using Phonegap 2.3.0 -



cordova - iOS notification.alert() not working using Phonegap 2.3.0 -

i have unusual issue when attempting utilize navigator.notification.alert() in xcode 4.6 using phonegap 2.3.0.

i have 2 files, index.html , other.html. clicking 'test alert' index.html triggers alert expected, after dismissing alert , navigating other.html, clicking 'test other alert' not trigger alert.

however, if click 'test alert' 2 or more times on index.html before moving other.html, alert go on function expected. it's after triggering alert 1 time , changing pages alerts stop functioning together.

index.html

<!doctype html> <html> <head> <script type="text/javascript" src="cordova-2.3.0.js"></script> <script type="text/javascript" charset="utf-8"> function alerttest() { navigator.notification.alert('testing', null, 'alert test', 'ok'); } </script> </head> <body> <a href='other.html'>move other page</a> <a href="#" onclick="alerttest(); homecoming false;">test alert</a> </body> </html>

other.html

<!doctype html> <html> <head> <script type="text/javascript" src="cordova-2.3.0.js"></script> <script type="text/javascript" charset="utf-8"> function alerttest() { navigator.notification.alert('testing', null, 'alert test', 'ok'); } </script> </head> <body> <a href="index.html">go back</a> <a href="#" onclick="alerttest(); homecoming false;">test alert</a> </body> </html>

i @ finish loss why happens, in app need able trigger alerts on button presses on different pages, seemingly hit-and-miss in example.

any help or nudge in right direction appreciated!!

update:

this seems happen ios 6 , 6.1 simulators. when alerts don't pop up, pressing home key , opening app 1 time again makes missing alerts appear @ once.

this illustration has same behaviour: http://docs.phonegap.com/en/2.3.0/cordova_notification_notification.md.html#notification

can confirm if simulator bug in latest xcode?

this problem exists since phonegap 2.2 see: notification in phonegap ios same problem on windowsmobile on phonegap 2.3.

i didn't update 2.1 ... seems lastly version worked properly.

don't forget add together document.addeventlistener("deviceready", ondeviceready, true); above.

ios cordova alert

No comments:

Post a Comment