Hi ,

I have phonegap app use Phonegap build I get the push message to the app but the title and content empty.

this is my event listener code:

//set push notifications handler
document.addEventListener('push-notification',
    function (event) {
        var title = event.notification.title;
        var userData = event.notification.userdata;

        //dump custom data to the console if it exists
        if (typeof (userData) != "undefined") {
            console.warn('user data: ' + JSON.stringify(userData));
        }

        //and show alert
        alert(title);

        //stopping geopushes
        pushNotification.stopGeoPushes();
    }
);
asked 14 Jul '14, 17:49
Tom%20Vaknin's gravatar image

Tom Vaknin
212

Hello Tom,

Empty push title and content is actually a well known issue, and its source is the wrong Android SDK choice in the Control Panel. Please double check whether you have specified the correct SDK in the Control Panel (Your app page -> Configure -> Edit application -> Android SDK).

(16 Jul '14, 07:16) Dmitry Dyudeev Dmitry%20%20Dyudeev's gravatar image

Hi Tom and Dmitry,

I am getting header but no message and all.

my code says this.

function initPushwooshAndroid() {

var pushNotification = window.plugins.pushNotification;
// Set push notification callback before we initialize the plugin. This is called when a push is received.
document.addEventListener('push-notification', function (event) {
    var title = event.notification.title;
    var userData = event.notification.userdata;
    var msg = event.notification.message;

    if (typeof (userData) != "undefined")
    {
        alert('user data: ' + JSON.stringify(userData));
    }

        alert(msg);
});

// This will trigger all pending push notifications on start.
pushNotification.onDeviceReady({ projectid: GOOGLE_PROJECT_ID, appid: PUSHWOOSH_APPID });
Deviceregister();

} Please help me?

Thanks, Vivek.

permanent link
answered 11 Sep '14, 07:39
vivekkumar96's gravatar image

vivekkumar96
112

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×190
×165
×91

question asked: 14 Jul '14, 17:49

question was seen: 1,841 times

last updated: 11 Sep '14, 07:39