Take the 2-minute tour ×

I want to implement gcm into my app and show the user once a dialog on startup with the question if he wants to receive notifications.

The procedure I am thinking to do:

AlertDialog question -> yes or no
Store answer in SharedPreferences
if(true) { register procedure etc }
rest of code

Is this the way to do it?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

You should add a preference item to allow users to change their mind whenever they want. Moreover showing a dialog at startup will get your app startup bloated and boring. It should start and be usable ASAP.

share|improve this answer
Yes and the dialog at startup will only be fired once... –  Harry Nov 21 '12 at 10:58
So do both : a dialog if you want to, and a preference item. Also apps should have a EULA, so this makes 2 dialogs... quite a lot, no ? I don't consider GCM notifications are worth a dialog if it's easy to stop. –  Snicolas Nov 21 '12 at 11:11
add comment

yes that s how it should be implemented , and if the user want to get unregistred from push service , you should simply call : GCMRegistrar.unregister(context)

share|improve this answer
add comment

Your Answer


