I am using GCM on iOS. Everything just works fine until application went to background and I can't receive push, I implemented Google sample code and also implement didReceiveRemoteNotification:fetchCompletion
and didReceiveRemoteNotification
. I use this struct to send push message and this works:
{
"to" : "ccoU4..d.",
"data": {
"message" : {
"test" : "Test"
}
}
}
but I change it to this for waking device from background and I get NotRegistered
error :
{
"to":".....",
"content_available":true,
"priority": "high", // Add this field corresponds to 10 for APNS
"notification": {
"title":"my title",
"body":"my body",
"sound":"default"
}
}
that is so strange, Google's documentation says I can add these two columns but it doesn't work