Wednesday, 15 May 2013

android - Disabling GCM push notification -



android - Disabling GCM push notification -

i utilize gcm force notification android app instant messenger line/what's app. in app, after user logs out, force notification go on happen. in other words, have no command on notifications.

ideally, notifications stop when user logs out of app , resume after logs in. in advance.

you should utilize sharedpreferences.

you should have preference contain value if user should alerted or not. let's say, 1 time user logged out - set preference value false. now,in gcmintentservice in onmessage method, check value of preference, if false, nothing.

have @ example:

how utilize sharedpreferences in android store, fetch , edit values

android google-cloud-messaging

No comments:

Post a Comment