0

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

谢谢

编辑

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

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

4

1 回答 1

0

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

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

按照链接。文档很好。希望这有帮助

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

于 2011-11-11T08:17:49.883 回答