Will I receive GCM messages if Android kills my application and if I do Force Close from the settings?

I'm new to Android development, and I'm interested in two things that are related to Google Cloud Messaging.

  • Is Android absolutely killing applications if they run in the background, how does iOS work? And if so, do I get GCM notifications after my application has been killed by Android?
  • Is there a difference between Force Close (from the settings menu) and when the application is killed by Android? And if I do Force Close, will I get GCM notifications?
+6
source share
1 answer

1 - yes, but if you install a broadcast receiver in your manifest that listens to gcm, it will still fire. What you will do with this event depends on your application. A common practice is to run an intent service that processes the message. It is up to you to interact with the actions of your application.

2 - From android 3.1, if the user force closes your application, it will cease to be notified of any broadcast until the user starts your application again. For details, see "Run controls on stopped applications" here .

+5
source

Source: https://habr.com/ru/post/944901/


All Articles