Closed eliavmaman closed 7 years ago
Hey @eliavmaman ! Have you checked out the GCM documentation for this error? https://firebase.google.com/docs/cloud-messaging/http-server-ref#error-codes
@eliavmaman are you using a notification_key or o a register_id as the input to the "to" field? I get 'NotRegistered" when using a notification_key. I get 'InternalServerError' when using a register_id... killing me.
@ColdLogical he isn't using the to
field at all, as far as I can tell.
Maybe you could create a new issue for your problem, showing your code? :smile:
Sure
@eliavmaman you code was right, If you get 'NotRegistered' as response means 2 reasons. @ColdLogicl please find the below link 👍 1 was: Unable to find the device GCM, it means device_id was not correct. 2 was: which you sharing device_id was correct but later you uninstall the app.
Note: If we uninstall & install the application / app you wan't get same device_id.
Try it once again, am also facing the same issue but later i found the issue. http://stackoverflow.com/questions/26718115/gcm-error-not-registered
@eliavmaman any news on your problem? Have you figured it out?
I will close this issue for lack of response in a day or two.
Closing due to lack of response. Please reopen if you still experience this issue.
Hi there Kind of reopen this one, even only to request clarification as we are experimenting a 'NotRegistered' issue in some devices for our app. That (some of devices vs a general problem) is what is tricky and is driving us a bit crazy, as we don't have barely a clue about where can be the problem
Everytime the app is started up or an user gets logged in, we register for a new registration id (aka push token) from google using phonegap-push-plugin:
window.pushPlugin = PushNotification.init({
"android": {
"senderID": "2934806289709", // fake senderID!!
"icon": "ic_stat_notif", // 2nd
"iconColor": "#3DB897"
},
"ios": {
"alert": "true",
"badge": "true",
"sound": "true"
}
});
We know GCM is responding ok as we have a handler push.on('registration', (data) => {...})
getting the registration id. This registration id goes to db and retrieved when the notification is sent to the user.
We tried to send notifications to two different devices with same user logged in and different registration ids got from GCM, but notification only gets to one of the devices. The 'good' device had the app reinstalled, but it always got notifications before; opposite for the other device. The output of our server with node-gcm
is:
user: 5837561415b60edd294940b3
deviceType: gcm
pushToken: cC3gJ-EVNWY:
{ title: 'try',
message: 'again',
payload: { type: 'backoffice', color: '#339966', image: 'icon' } }
[PushNotification] data sent: {"message":"again","payload":{"type":"backoffice","color":"#339966","image":"icon"},"title":"try","silent":false,"content-available":"1","image":"icon","color":"#339966"}
__________
user: 5837561415b60edd294940b3
deviceType: gcm
pushToken: c7mGtqQFsgo:
{ title: 'try',
message: 'again',
payload: { type: 'backoffice', color: '#339966', image: 'icon' } }
[PushNotification] data sent: {"message":"again","payload":{"type":"backoffice","color":"#339966","image":"icon"},"title":"try","silent":false,"content-available":"1","image":"icon","color":"#339966"}
_____ {"multicast_id":7548672446445251000,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"NotRegistered"}]}
_____ {"multicast_id":7787133779606711000,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1481547590905892%42a147f9f9fd7ecd"}]}
(pushToken is the registration id; c7mGtqQFsgo
is the 'successful' one)
We checked https://developers.google.com/cloud-messaging/http-server-ref#table9, but no one of the four points depicted in that table, 'Unregister device' error, seems to apply.
Any hint or guess about it? Thanks in advance, will report here if we solve the problem before (even if this is, ultimately, a silly issue 😖 )
Cheers
@telekosmos I recall having a similar issue because I was also re-registering devices every time the app was opened. Google asks that we re-register devices when:
1) The device has not been registered yet 2) The app was updated
I'm not entirely sure why, but once I stopped re-registering all the time, the issue went away.
this is what i get when trying to use the basic of node-gcm....