Notification In Phonegap For Ios
I need to use on notification in PhoneGap 2.2.0 for iOS. I add to PhoneGap.plist -> plugin ->com.phonegap.notification (also try just notification) and it not work. Here Ph
Solution 1:
Apache Cordova Documentation says,you need to add following lines in App/Supporting Files/Cordova.plist
<key>Plugins</key><dict><key>Notification</key><string>CDVNotification</string></dict>
and find a sample code here
<!DOCTYPE html><html><head><title>Notification Example</title><scripttype="text/javascript"charset="utf-8"src="cordova-2.1.0.js"></script><scripttype="text/javascript"charset="utf-8">functiononConfirm(buttonIndex) {
alert('You selected button ' + buttonIndex);
}
functionshowConfirm() {
navigator.notification.confirm(
'EXIT?',
onConfirm,
'Good-Bay',
'Cancle,OK'
);
}
</script></head><body><p><ahref="#"onclick="showConfirm(); return false;">Show Confirm</a></p></body></html>
I think this helped you.
Solution 2:
Try this,
function onConfirm()
{}
navigator.notification.alert(
'EXIT?', // message
onConfirm, // callback to invoke with index of button pressed'Good-Bay', // title'OK'// button
);
Solution 3:
I have no idea what the problem on version 2.2,
I downloaded the latest version of PhoneGap (2.3.0) and it worked ..
Post a Comment for "Notification In Phonegap For Ios"