Sender ID Cordova Plugin Push

0

I'm developing an application that needs to be able to receive notifications via the server, and for that, I opted to use a plugin called phonegap-plugin-push

var push = PushNotification.init({
  "android": {
      "senderID": "XXXXXXXX"
  },
  "ios": {
    "sound": true,
    "alert": true,
    "badge": true
  },
  "windows": {}
});

push.on('registration', function(data) {
  alert("registration event: " + data.registrationId);
  var oldRegId = localStorage.getItem('registrationId');
  if (oldRegId !== data.registrationId) {
      // Save new registration ID
      localStorage.setItem('registrationId', data.registrationId);
      // Post registrationId to your app server as the value has changed
  }
});

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

push.on('notification', function(data) {
 console.log('notification event');
 navigator.notification.alert(
    data.message,         // message
    null,                 // callback
    data.title,           // title
    'Ok'                  // buttonName
 );
});

Where, regardless of the Sender ID used, it returns the same Device ID, I have already created other projects in google firebase, to change the senderID and consequently change the device ID, but always returns the same.

Thanks in advance for your help

    
asked by anonymous 20.12.2017 / 16:45

1 answer

0

I was able to resolve, I was using version 2.1.2, for some reason it was not working properly with Android, so I had to downgrade to version 1.8.0, so it worked perfectly.

    
21.12.2017 / 14:04