ios - 如何通过 Google Cloud Messaging 向 iOS 发送静默推送

标签 ios apple-push-notifications push google-cloud-messaging

如何通过 GCM 向 iOS 应用程序发送静默推送通知?

静默推送是通知不会出现在通知中心,而是唤醒应用程序在后台做一些 Action 。 Google 在新版中介绍新功能 GCM可以向 Android、Chrome 和 iOS 发送推送消息。

知道怎么做吗?

最佳答案

像这样使用 content_available(不是 content-available)属性:

curl -X POST --header "Content-Type:application/json" --header "Authorization:key=AIzaXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" "https://android.googleapis.com/gcm/send" --data-ascii '{"data":{"xxx":"yyy"},"content_available":true,"to":"XXXXXXXXXX:YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY-ZZZZZZZZZZZZZZZZZZZZ"}'

关于ios - 如何通过 Google Cloud Messaging 向 iOS 发送静默推送,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30616302/

相关文章:

ios - Swift - NSURLSession 恢复后完成操作

ios - [NSURLSessionDataTask 响应] : unrecognized selector sent to instance

android - 是否在后台重复处理?

iphone - Apple Push Certificate - 无效的证书签名请求

混帐推送 "The remote end hung up unexpectedly "

java - cf 推送失败 Java 版本不匹配

ios - 对日历守护程序的谓词调用失败 : Error Domain=EKCADErrorDomain Code=1013

actionscript-3 - 从 AIR 桌面客户端发送推送通知,无需中间件(例如 PHP)

ios - Facebook App邀请通知问题