Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Long-polling vs Apple Push Notification Service & Android C2DM [closed]

I am building a mobile application that has some realtime constraints. Therefore I turn to stackoverflow to get advices & opinions and attempt to decide which is the best solution to update the state of the application while running:

  1. rely on long-polling or direct connection to my server
  2. rely on Apple Push Notification Service and Android C2DM

Beyond the fact that APNS and C2DM provide a unified interface to push notification while the application is running or not, one can say that a custom solution (based on long-polling or a direct connection) is more flexible and less dependent on the latency of Apple & Android queues.

As far as I can see, I think most of the debate stems from the cost comparison of how much battery it consumes to keep a connection opened compared to opening a connection on a smartphone.

I am therefore particularly interested in two things:

  • Experiences with APNS and C2DM
  • Details on all the implications of keeping a TCP connection open on a smartphone.

References welcome! Thanks!

like image 1000
spolu Avatar asked Jan 04 '11 17:01

spolu


1 Answers

dependent on the latency of Apple & Android queues

I don't think that's true. It's up to the app developer and the server side implementation how much time this takes. I get my email pushed to my phone before my browser client gets it. And not just gmail, my corporate e-mail as well.

As for your question, you should work with whatever works best. Or even better, you should give the user the option to use push notifications or to set the polling period.

like image 109
Falmarri Avatar answered Nov 15 '22 13:11

Falmarri