On Phonegap build app - I get an alert with the push notification?



  • Avatar

    I believe this is the correct functionality. If you wish to change the way the notification is displayed you can make changes to the following code.

    document.addEventListener('push-notification', function(event) {
        var title = event.notification.title;
        var userData = event.notification.userdata;
        console.warn('user data: ' + JSON.stringify(userData));
        alert(title);  // CHANGE THIS LINE OF CODE

    It sounds like you wish to add the message to the DOM of your index.html page. You can do that using code like this:

  • Avatar
    Ghassan Safadi

    If using Phonegap Build:

    Add to Config.xml the Plugin:

    "org.apache.cordova.dialogs" version="0.2.6" />

    Update PushwooshiOS.js:

    document.addEventListener('push-notification', function(event) {

            //get the notification payload
            var notification = event.notification;
             //ADD the Dialogs Plugin Function
            //DISABLE the iOS Native Alert Function
                        //display alert to the user for example
            //to view full push payload
            //clear the app badge

Please sign in to leave a comment.