I need to catch up with a notification from GCM. I do not receive notifications when my application is in the background. But I see them when he is in the foreground.
for the GCM test functions, I use it:
curl -X POST -H "Authorization: key= KKKKKKKKKKKK" -H "Content-Type: application/json" -d '{"to":"XXXXXXXXX","data":{"message": "It is special push notification for test!!!"}}' https://gcm-http.googleapis.com/gcm/send
I see this message (if the application is active). but when i use it:
curl -X POST -H "Authorization: key= KKKKKKKKKKK" -H "Content-Type: application/json" -d '{"to":"XXXXXXXX","data":{"message": "It is special push notification for test!!!"},"notification":{"body":"great match!","title":"Portugal vs. Denmark","icon":"myicon"}}' https://gcm-http.googleapis.com/gcm/send
In this case, I do not see the message.
Do you know how to send notifications via GCM that will be displayed when the application is turned off?
PS It seems that GCM does not work with APN.
source
share