Estou desenvolvendo um aplicativo que precisa estar apto a receber notificações via servidor, e para isso, optei na utilização de um plugin chamado 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
);
});
Onde, independentemente do Sender ID utilizado, ele retorna o mesmo Device ID, já criei outros projetos no google firebase, para alterar o senderID e consequentemente alterar o device ID, porém sempre retorna o mesmo.
Desde já, agradeço pela ajuda