0

I use GCM for notification

If application closed , GCM send auto notification to mobile

I want this notification disabled and only use onReceive class

If application closed , receive 2 notification and duplicated !

1- From server

2- From onReceive

Please help for solve this problem

Mohammad
  • 111
  • 2
  • 13

1 Answers1

0

You should use SharedPreferences. You should have a preference that contains the value if the user should be alerted or not. Set the preference value to false/true. In youir GCMIntentService in the onMessage method, check the value of the preference if its false, just do nothing.

Have a look at this, it shows How to use SharedPreferences in Android to store, fetch and edit values

Community
  • 1
  • 1
Android Enthusiast
  • 4,826
  • 2
  • 15
  • 30