1

我已经为 android 实现了一个推送通知系统。我的系统工作如下:从我的服务器,我通过 Http 协议与谷歌服务器进行通信。然后谷歌服务器将通知发送到手机。所以,我想知道是否有任何替代方法来实现此功能。但是,我想要一些可靠的东西。

PS我想听听人们的意见,他们实现了类似的东西。

4

2 回答 2

1

I was working with some Chinese tablets that could not receive android push notifs (very annoying). I had to implement a Comet like system on android.

Basically, on the android device, I created a service which essentially polled a URL. But since polling is very battery intensive, I used a push technique called long-polling. I had the Android http client set a very long timeout. I then on the server side had the server hold the connection open also for a very long time. What would end up happening is that as soon as a message had to be passed, the connection would finish, and the android device would get the message immediately. This is just an additional method of "push" technology.

The only other option not discussed here is a persistant TCP/IP connection. This can be very dicey because Android could kill the service at will, and it can be somewhat battery intensive as well.

From my experience, GCM is the best method out there, and I wish there was something as good as it available for iOS Devices!

于 2013-01-30T15:27:21.693 回答
1

不知道你为什么要寻找其他东西,如果你已经让它通过谷歌服务器工作,但一个很好的系统可以轻松发送推送通知是Urban Airship。

于 2013-01-30T15:19:00.253 回答