谷歌云消息通知发送到所有设备 [英] Google Cloud Messaging send notification to all devices

查看:247
本文介绍了谷歌云消息通知发送到所有设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在GCM新。我想发送消息到安装了应用程序的所有设备。我读到registration_id:到GCM第一次连接后,谷歌这个唯一的字符串发送到设备。我是一个初学者在服务器领域,但如果我没有记错,在服务器端,发送通知给设备我要送registration_id的阵列和谷歌的消息。

谷歌知道如何拥有注册ID?
有没有办法将消息发送到所有的设备,而无需通过registrarions ID?
谢谢你。


解决方案

  

有没有办法将消息发送到所有的设备,而无需通过registrarions ID?


没有办法。结果
GCM上注册成功后,您(Android应用程序)应发送注册ID到你的应用服务器和它们存储在例如数据库中的某个地方。该注册ID将被用于一个通知发送到特定的设备。

要发送通知到所有设备,将意味着然后从该数据库中选择所有的注册ID,正如你所说,把它们放在一个阵列,并进一步通过他们GCM。

I'm new in GCM. I would like to send an message to all devices that have the app installed. I read about registration_id: after the first connection to GCM, google send this unique string to device. I'm a beginner in server world but if I'm not mistaken, in server side, for sending a notification to devices I have to send array of registration_id and the message to google.

Google knows how has the registration id? Is there a way to send messages to all devices without pass the registrarions id? Thank you.

解决方案

Is there a way to send messages to all devices without pass the registrarions id?

No way.
After successfully registering on GCM, you (the Android application) should send the registration id to your application server and store them somewhere, in a database for example. This registration id will be used to send a notification to a particular device.

To send a notification to all devices, would mean then to select all the registration ids from that database, and as you said, put them in an array and pass them further to GCM.

这篇关于谷歌云消息通知发送到所有设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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