Push Notifications status check Android

2019-06-23 19:51发布

问题:

User can disable push notifications in later versions of android for an application, is there any way application can know that push notifications are disabled by user in settings ?

回答1:

Look here: http://developer.android.com/google/gcm/adv.html#unreg
There one way is explained.

Another way could be:
If you have implemented a GCM server then your app sends a message to the server that it does not want any updates anymore.
After that the server deletes the regId from its devices database.
From now on your device should not get any Push Messages.

You could also try to make a client side decision and filter the messages if the user does not want any push messages (that way they would still be sent on the server side)

So I would implement a server side solution. Seems to be the cleanest way for me.