stop gcm to send notification on old registration id

166 Views Asked by At

Suppose that case when the client app has re-registered with the gcm itself but the server is unaware of this and now the server is sending notification to that particular client what I want is the notification should not be sent with the old registration id. How can this be done?

1

There are 1 best solutions below

3
AL. On

If your server sends a message to an invalid Registration token, it will probably receive a NotRegistered error response. You should handle this error accordingly by removing the corresponding token. As per the documentaion I linked above:

For all these cases, remove this registration token from the app server and stop using it to send messages.