- After completing the setup, start testing. Launch the App, then kill it. Send a test message. No push notification is received.
- Launch the App again, kill it, and send a test message. This time, the push notification is received.
After killing the App for the first time and sending a test message, the following log appears immediately:
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 GCM log shows result=CANCELLED. The broadcast intent callback was cancelled. This means the broadcast was intercepted and failed by the system before reaching the App or SDK layer.
Initially, it was suspected to be a permission issue with GCM or FCM, a missing configuration in the manifest, or the App’s notification permission not being enabled. After checking and configuring, the issue persisted.
After seeking help from Google and StackOverflow, similar issues were found, but no good solutions were available. Trying various online solutions didn’t resolve the persistent issue.
Later, an accidental discovery was made: if the App was installed and run on the mobile device by directly clicking “Run” in the IDE, the issue occurred. However, packaging the project into an apk and installing it on the mobile device resolved the issue. After the first time killing the App, the message was successfully received. Only then was this issue resolved.