I am testing the sample project for gcm notification from google https://developers.google.com/cloud-messaging/android/start
This project is using com.google.android.gms:play-services-gcm:9.0.0
After I install the app to my phone via android studio. I kill the app from my phone(not force kill from setting). Then, I tried to send notification message according to google instruction.
Notification cannot show on my phone. When I check the logcat. I found the following log about GCM.
06-08 11:19:37.859 5080-5080/? W/GCM-DMM: broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=gcm.play.android.samples.com.gcmquickstart (has extras) }
After that I launch the app in phone and kill the app again, then send GCM again to my phone. At that time, notification can show correctly in my phone. It seem, application need to restart one time for receiving gcm notification or application should be received notification before user kill the app.
How should I solve this problem? As I know, lower version of play-services-gcm:9.0.0 do not have this kind of problem.