on one of our applications that uses GCM, we've been receiving reports that the app stops receiving notifications when the app has been killed. When the app is started again, the notification appear as normal.
After investigation, we found out that this is due to this change on Android 3.1:
Note that the system adds FLAG_EXCLUDE_STOPPED_PACKAGES to all broadcast intents. It does this to prevent broadcasts from background services from inadvertently or unnecessarily launching components of stoppped applications. A background service or application can override this behavior by adding the FLAG_INCLUDE_STOPPED_PACKAGES flag to broadcast intents that should be allowed to activate stopped applications. (Android 3.1 changes)
I inspected the intent that is fired by GCM when a notification has been received, and I noticed that FLAG_EXCLUDE_STOPPED_PACKAGES is indeed set.
This means that all users who run our app on Android 3.1+ will stop receiving notifications once they kill their app, until they restart it themselves. (Pre-Android 3.1 works just fine).
Since the intent is fired by the GCM framework itself, we cannot change the flags that are set on it, and so we're looking for another workaround.
All ideas are appreciated.