当iOS应用程序被终止时,Gcm未发送到apn
Gcm在前台和后台运行时发送给apn。当iOS应用程序被终止时,Gcm未发送到apn,ios,iphone,google-cloud-messaging,Ios,Iphone,Google Cloud Messaging,Gcm在前台和后台运行时发送给apn。 “GcmServerDemo”工具 “APN测试仪”工具您应该尝试具有高APN优先级的消息 curl --header "Authorization: key=$server_api_key" \ --header Content-Type:"application/json" \ https://android.googleapis.com/gcm/send \ -d "{ 'data': {
“GcmServerDemo”
工具
“APN测试仪”
工具您应该尝试具有高APN优先级的消息
curl --header "Authorization: key=$server_api_key" \
--header Content-Type:"application/json" \
https://android.googleapis.com/gcm/send \
-d "{
'data': { 'title': 'title' }, \
'notification': {'body': 'notitest' }, \
'content_available': true, \
'to': '$token', \
'priority': 10,
}"
您需要将优先级
明确设置为10
,否则GCM将采用正常的APNS优先级,这可能会导致严重延迟
您可以在其中阅读有关
优先级
字段的信息。如果您的应用程序从应用程序切换器终止,则您的应用程序将不会收到推送通知。您可以看到,根据测试结果,我尝试过,在强制关闭应用程序后,“APN测试仪”可以发送通知。
curl --header "Authorization: key=$server_api_key" \
--header Content-Type:"application/json" \
https://android.googleapis.com/gcm/send \
-d "{
'data': { 'title': 'title' }, \
'notification': {'body': 'notitest' }, \
'content_available': true, \
'to': '$token', \
'priority': 10,
}"