2

I am using Phonegap 5.0 and phonegap-plugin-push trying to make push notifications work.

my js code so far is this:

document.addEventListener("deviceready", function () {

    var push = PushNotification.init({ "android": {"senderID": "mySenderId"},
    "ios": {}, "windows": {} } );
    console.log(push);

    push.on('registration', function(data) {
        console.log("registration", data);
    });

    push.on('notification', function(data) {
        console.log("notification", data);
    });

    push.on('error', function(e) {
        console.log("error", e);
    });
});

there are no errors, I expect to see when some event happens, but I see only one console.log - this one for the "push" object, which I see is PushNotification object, but nothing for the rest.

How am I supposed to make it "ask" google for device id ?

Edit: I got the impression this should work on the emulator too, but it doesn't. When I run it on actual device it works fine. Is there any way to make it work in the emulator?

gotha
  • 489
  • 1
  • 5
  • 20

1 Answers1

0

please make sure you are assigned your senderID correctly. It seems to me that there is no mistake in the code.

Nadeem Khoury
  • 886
  • 6
  • 18