Search code examples
androidpush-notificationgoogle-cloud-messagingandroid-4.2-jelly-bean

Push notification for apps that are not running?


I'm studying GCM now and as far as I see it works for running apps, passing a payload to them and letting the app to deal with it by itself.

However, I've seen apps that are received notifications (or maybe it was Android receiving and showing notification related to the app) when not running. For example, device was turned off. I'm just turning the device on, then turning on Wi-Fi and after a second I see new notifications with the app's icon on it and some text related to in-app events.

How could I implement that kind of notifications?


Solution

  • declare the Broadcast Receiver and the GCMIntentService in the mainfest will allow the Application to get any Message (GCM Included of crouse) if the application not running

    BroadcastReceiver Example and Documantion