如何通过 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/