In our app I would like to present the user so he can deactivate GCM so that no more messages are received.
How can I do that/? I tried calling the
GCMRegistrar.unregister()
but the broadcast receiver still gives me messages.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do two things. First one is when the user disable the GCM service, the app should send to your server a message to update a true/false field in your DB and when you send a new notification push, you only send the notification token to the devices are enabled.
Or, I don’t test this solution. When you’ll generate the notification in the device, you’ll check if the user disabled the notification. If the user does, the notification won’t be created (With a if sentence). You should use to save this functionality a shared preference.