Google Cloud Messaging showing success message but not sending iOS -
so have run strange problem google cloud messaging. problem having is registering devices successfully, , when message sent success message google. devices never receive messages.
the message gcm is:
"result": "push notification sent successfully: {\"multicast_id\":6008387530769664000,\"success\":1,\"failure\":0,\"canonical_ids\":0,\"results\":[{\"message_id\":\"0:1442824842607522%73fc535e73fc535e\"}]}"
to make things more confusing, implementation working 2 weeks ago , have not changed date. android version of app receiving messages no problems ios implementation not working.
any appreciated!
thanks!
so solved issue after of pulling last remaining hairs out of head.
it turns out devices receiving messages gcm sets priority lowest priority default. means device receives notification never displays it. priority used silent notifications wake app in background. discovered because kept receiving message in console saying:
low priority push: [com.test.app] - background refresh not supported
priority value between 1 , 10 set priority 10 , got message instantly on device. gcm post request body looks this:
{ "to": "gcm token here", "notification": { "sound": "default", "badge": "2", "title": "default", "body": "test push!", }, "priority" : 10, }
i hope helps others have spent week pulling hair out regarding this.
(ノಠ益ಠ)ノ
edit:
you can set "priority" "high" , works same setting "10" (priority value between 0 , 10. google coverts text number ios
Comments
Post a Comment