如何通过 Google Cloud Messaging 向 iOS 发送静默推送 [英] How to send silent push to iOS via Google Cloud Messaging

查看:26
本文介绍了如何通过 Google Cloud Messaging 向 iOS 发送静默推送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How to send silent push notification to iOS application over GCM?

静默推送是不会出现在通知中心的通知,而是唤醒应用程序在后台执行某些操作.Google 在新的 GCM 中引入了新功能,可以向 Android、Chrome 和 iOS 发送推送消息.

Silent push is notification that will not appear in notification center, but awake application to do some action in background. Google introduce new features in new GCM with possibility to send push messages to Android, Chrome and iOS.

知道怎么做吗?

推荐答案

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

Use the content_available (not content-available) attribute like this:

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"}'

这篇关于如何通过 Google Cloud Messaging 向 iOS 发送静默推送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆