1

All of my questions are in context of Chrome Web Push Notifications, as released in Chrome Version 42.

1) GCM API returns 'Success' for even those Registration IDs which are no longer valid. When a person right clicks on the notification, and clicks on 'Disable notifications from xyz.com', the person can no longer receive notifications. However, when i send the same RegistrationID to GCM API, it still returns success for that particular registration. When i resubscribe again, i get a new RegistrationID. Therefore, I suspect that the previous one gets disabled. Is this intended behaviour? Is there any way for us to know if people have unsubscribed by right clicking on the notification and mark them as inactive in our database, in case, the user never comes back again.

2) GCM Documentation for Error=NotRegistered says "The client app isn't configured to receive push messages or the app was uninstalled from the device". Can you please explain what does "The client app isn't configured to receive push messages mean"?

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
Kanishk Dudeja
  • 1,201
  • 3
  • 17
  • 33
  • These are two questions. but the second one is easy notregistered means you can no longer send to that ID. Please post as two questions you might get answers. – e4c5 Sep 24 '15 at 12:21

1 Answers1

2

Disable notifications from xyz.com

All this does is revoke the notification permission in Chrome and unregister from push. The GCM server might take a while to realize that such registration is no longer valid since the unregistration happens locally and it can take a while to be synced back to the servers.

Is there any way for us to know if people have unsubscribed by right clicking on the notification and mark them as inactive in our database, in case, the user never comes back again.

Sending messages to that registration id will eventually start returning a permanent error (one of 'InvalidRegistration', 'NotRegistered', 'InvalidPackageName', 'MismatchSenderId')

You can see a working example of this in https://github.com/johnmellor/push-api-appengine-demo/blob/master/main.py#L349

Miguel Garcia
  • 1,029
  • 5
  • 14