如何实现多个Android应用程序的推送通知?
我们的产品仍然以操作系统 1.5+ 为目标,因此 Froyo 中的 C2DM 不是一个选择。
我认为将持久 TCP 连接包装在服务中是可行的。但我仍然想知道如何使用一项服务来接收多个应用程序的通知。我不想为每个应用程序创建服务和连接。
我应该尝试在所有应用程序中注册相同的服务,还是将服务作为单个应用程序发布?
提前致谢。
Our products still target OS 1.5+, so C2DM in Froyo is not an option.
I think wrap a persistent TCP connection in a service would be feasible. But I'm still wondering how to use one service to receive notifications for multiple applications. I don't want to create service and connection for each of my apps.
Should I try to register the same service in all my apps, or release the service as a single app?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查看 Urban Airship 在 Android 2.2 之前版本的推送通知实现方面所做的工作。他们有一个名为 AirMail 控制面板的集中式应用程序,它可以为使用其推送服务的多个应用程序配置推送设置。
文档位于此处。
You can have a look at what Urban Airship has done with their implementation of push notifications for Android pre-2.2. They have a centralized application called AirMail Control Panel which configures push settings for multiple applications that use their push service.
The documentation is here.