广播推送通知到android c2dm

时间:2011-11-11 07:13:17

标签: android android-c2dm urbanairship.com

如何使用我的应用程序向所有设备广播推送通知。我在Urban飞艇上看过这个功能,它向所有有应用程序的设备发送广播消息。我需要使用自己的程序发送广播。这可以吗?如果有,怎么样?我在谷歌搜索但我找不到令人满意的答案。任何与此相关的链接都会有所帮助。

谢谢

修改

curl --header "Authorization: GoogleLogin auth=*my auth key here*" "https://android.apis.google.com/c2dm/send" -d registration_id=<registration id of the device> -d "data.payload=You have recieved a Push Notification" -d collapse_key=0 -k

我一直用它来发送通知,通知会传递给注册设备,即模拟器。我需要向使用我的应用程序的所有设备发送通知。它是如何实现的?

1 个答案:

答案 0 :(得分:0)

来自谷歌的C2dm可以将推送消息发送到在多个设备上运行的应用程序。为此,您必须使用谷歌c2dm服务注册一个Gmail帐户。此外,您的设备应该已经使用谷歌帐户注册任何谷歌帐户,并且应该安装市场

http://code.google.com/android/c2dm/signup.html

按照link.documentation是good.hope这个帮助

http://blog.mediarain.com/2011/03/simple-google-android-c2dm-tutorial-push-notifications-for-android/
http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html

也可以看看上面的基础教程

你的应用程序结构应该有点像所有设备在注册并循环通过这些ID并发送消息时接受注册ID