Kanishk Dudeja
Kanishk Dudeja

Reputation: 1221

Google Cloud Messaging for Chrome Web Push Notifications Issues

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"?

Upvotes: 1

Views: 443

Answers (1)

Miguel Garcia
Miguel Garcia

Reputation: 1029

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

Upvotes: 2

Related Questions