There was a problem with Android push notifications (GCM) on Android 3.1: when my application is closed, the broadcast receiver that should handle GCM (Intents) push messages is never called.
In lower versions of Android, everything works fine. The broadcast receiver is always called (even when the application is closed).
I know that with Android 3.1 a new concept has appeared: when the application does not work, it is in the βstoppedβ state: http://developer.android.com/about/versions/android-3.1.html#launchcontrols
So, if you want to start a "stopped" application through Intent, you must add the FLAG_INCLUDE_STOPPED_PACKAGES flag to Intent.
But the problem is that I cannot add the FLAG_INCLUDE_STOPPED_PACKAGES flag to the GCM intent because GCM Intents (I mean "com.google.android.c2dm.intent.RECEIVE" and "com.google.android.c2dm.intent. REGISTRATION ") are discarded by the OS.
So my question is: how can I process push messages (on android 3.1) from GCM through a broadcast receiver in a situation where the application (in which the broadcast is registered) is closed (in the "stopped" state)?
source share