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 ?
Asked
Active
Viewed 3,314 times
6
-
1I think you can try to use [Unregistration](http://developer.android.com/google/gcm/adv.html#unreg) in GCM, so that the app stop receiving messages. – bjiang Jan 30 '15 at 18:17
-
1@bjiang is there a way to identify is push enabled or disabled ?? – sij Jan 30 '15 at 19:38
-
"application" can know that push notification is enable/disable.... You mean, which "application"? Android application in mobile device? or 3rd party app server which send push notification to mobile device? – danisupr4 Feb 02 '15 at 11:16
1 Answers
0
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.

maksim
- 176
- 7
-
my question is how to check the status of push notification in client itself – sij Jan 30 '15 at 19:25
-
oh, you mean that! Maybe you could try to query the [NotificationListenerService](http://developer.android.com/reference/android/service/notification/NotificationListenerService.html) (in getActiveNotifications() you would get all currently shown notifications and search for yours) – maksim Jan 30 '15 at 19:36
-
1@maskim some thing like this http://stackoverflow.com/questions/1535403/determine-on-iphone-if-user-has-enabled-push-notifications – sij Jan 30 '15 at 19:44