Skip to content Skip to sidebar Skip to footer

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>

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

    function onConfirm(buttonIndex) {
        alert('You selected button ' + buttonIndex);
    }

    function showConfirm() {
        navigator.notification.confirm(
             'EXIT?',  
              onConfirm,          
             'Good-Bay',          
             'Cancle,OK'          
        );
    }

    </script>
  </head>
  <body>
    <p><a href="#" 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"