如何通过谷歌云端通讯无声推给iOS [英] How to send silent push to iOS via Google Cloud Messaging

查看:136
本文介绍了如何通过谷歌云端通讯无声推给iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何无声推送通知了GCM给iOS应用程序?

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

静音推是不会出现在通知中心通知,但清醒的应用程序做一些背景的动作。
谷歌推出与新的可能性 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.

任何想法,如何做到这一点?

Any idea, how to do this?

推荐答案

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

这篇关于如何通过谷歌云端通讯无声推给iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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