Description
When the app is first installed but not yet launched, or after the app is force stopped, FCM push notifications can’t be received.
09-17 11:50:34.298 W/GCM ( 2025): broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=com.rongcloud.fcm_demo (has extras) }
The log shows result=CANCELLED
, indicating that the broadcast intent callback was in a CANCELLED
state. This means the broadcast was intercepted by the system before reaching the app/SDK layer.
The issue persists even after ruling out FCM permission issues, manifest configuration problems, and app notification permission settings.
Analysis
Android officially states that this behavior is expected. Apps that are first installed but not yet launched and apps manually stopped by the user (via “Manage apps”) will be in a stopped state. The system adds FLAG_EXCLUDE_STOPPED_PACKAGES
to all broadcast intents. This prevents broadcasts from background services from unintentionally or unnecessarily starting components of stopped apps. For more details, refer to the Android documentation: Launch controls for stopped apps .
The following answer on Stack Overflow also explains the issue:
It looks like you have an issue when your app is force stopped or killed. Actually, this is working as intended. The Android framework advises that apps that have been stopped (i.e. killed/force-stopped from Settings) should not be started without explicit user interaction. FCM follows this recommendation and thus its services will not start as well. This also means that messages will not be received (FirebaseMessagingService will not be called) when the app is in “killed” state. Here are some useful links so you could have a better understanding on this topic:
Solution
The following solution is from the Android documentation: Launch controls for stopped apps
Note that the system adds
FLAG_EXCLUDE_STOPPED_PACKAGES
to all broadcast intents. This prevents broadcasts from background services from unintentionally or unnecessarily starting components of stopped apps. Background services or apps can override this behavior by adding theFLAG_INCLUDE_STOPPED_PACKAGES
flag to broadcast intents that should allow activation of stopped apps.
Further support
If you have any questions, feel free to submit a ticket.