onMessageReceive() not fired anymore in background on GCM/FCM data message

421 views
Skip to first unread message

Tourism SecondGuide

unread,
Jul 22, 2016, 11:17:41 AM7/22/16
to Firebase Google Group
Hello,

I have a perfectly running application published, built at the begining of july with Studio 1.5.2, build Tools version available at that time (23 AFAIR) and java 1.7, which is able to receive data only message via onMessageReceive() sent by Google Advanced REST Client.
This version uses FCM 9.2.0.

Then, I updated Studio to 2.1.2, build Tools to 24.0.0, Java to 1.8 and I noticed that the built application doesn't receive any data message only anymore when it's in background (i.e. the application swiped out of the recent apps list).

After many hours to investigate, I decided to rebuild the project corresponding to the published version. In case...

The rebuilt application doesn't receive data message in background!

I tested a more older project again using GCM 8.4.0 which worked, and the rebuilt application doesn't receive data message in background!

Searching through the web, I can see that for some people it works, and it worked for me as well recently, and for some others it doesn't.

So I suspect that some development environment updates cause the problem and it's not related to GCM or FCM because I get the same issue with both systems GCM 8.4.0 or FCM 9.2.0 and  9.2.1.

And it's not related to the device or Android version because previously built application run on all my devices/Android version (5.0.1 to 6.0.1) and newly built project doesn't work on any device/Android version.

I also made a test with firebase quickstart-android messaging app and I make the exact same noticing.

So you can make a test by simply starting from firebase quickstart-android project.

Notice that I get the same problem on 2 different computers and on one of them, I uninstalled/reinstalled everything with always the same problem!

One precision again; Just after and every time I send a data message to my background application, I receive the following message in logcat. 
So the device receives the message but is not able to pass it to the application:
07-18 15:28:34.371 3068-3068/? W/GCM-DMM: broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10000000 pkg=com.google.firebase.quickstart.fcm (has extras) }

The sent message is:
{ "to" : "egu9jGiMcew:APA91bFv2RewdzlrC4Q0 ... dYZgv91oZVfTtrfAojLMKZZmEURvbq-aA2",
   
"data": { "title": "Title test", "msg": "Text of the test", "code": 2 },
   
"delay_while_idle" : false,
   
"priority" : "high",
   
"content_available" : true
}

And it's successfully sent of course. Regards,
Reply all
Reply to author
Forward
0 new messages