1

I am using Node GCM.

The notifications are working fine in certain devices of my customer. Some phones have this issue where they do not get the notifications after a certain time period.

After checking the logs I saw the below error in some calls.

{"multicast_id":7040074623564131000,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"NotRegistered"}]

I do not get canonical_ids as 1 or above, for this response or on any responses before it.

I followed the steps mentioned in Canonical Registration ID and message ID format and I did not get any canonical ids in the response.

In some phones, the GCM works just fine so I'm not sure how to proceed from here and where to debug.

Community
  • 1
  • 1
Raam Rajaram
  • 33
  • 1
  • 4
  • Check this [SO thread](http://stackoverflow.com/questions/26718115/gcm-error-not-registered) with regard to your error, it might offer some insight. – ReyAnthonyRenacia Jul 20 '16 at 10:31

3 Answers3

0

NotRegistered - is a message, which say, that there is no any GCM device registered with passed id. Just check id.

You must send push notifications only on devices, which are registered in GCM and in your app (via developer console).

You can test it with different Rest clients like postman. Just send your data on special url using json.

Oleg Skidan
  • 617
  • 6
  • 24
  • I notice that it works in the beginning, during installation of the app(This is when we get the fresh token from GCM) and stops working after a certain point in some devices. – Raam Rajaram Jul 19 '16 at 12:14
  • Are you sure, that devices not get new token later? – Oleg Skidan Jul 19 '16 at 12:18
  • Unfortunately no. I do not get canonical_ids as 1 or above. Even followed the steps mentioned in http://stackoverflow.com/questions/12808959/canonical-registration-id-and-message-id-format/12978274#12978274 – Raam Rajaram Jul 19 '16 at 12:22
  • As my mentor said: "Try to debug step by step"... It's just, what I can advise you in this case. – Oleg Skidan Jul 19 '16 at 12:26
0

This generally happen if your device token not registered properly may be due to storage length ..so always use text instead of varchar and if use varchar then give the size above 200 .. .. Thanks

Vishal
  • 478
  • 1
  • 5
  • 16
0

I spended some days try to figure out how to resolve a similar problem and when I tried something I thought stupid it worked. In Android, when generating the token, I changed the scope from "GCM" to "" and after that i didn't receive NotRegistered anymore.

Change:

String token = instanceID.getToken(getString(R.string.gcm_defaultSenderId),
         GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);

To:

String token = instanceID.getToken(getString(R.string.gcm_defaultSenderId),
         "", null);

I don't know why but it works to me.

Carlos Aires
  • 151
  • 2
  • 4