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

1

12

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!

Blockish answered 4/1, 2011 at 17:10 Comment(0)
U
2

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.

Underglaze answered 4/1, 2011 at 17:49 Comment(3)
Thanks for your answer! As for letting the user choose, I am not sure my user base would know what polling period is...Blockish
Why not? Pretty much every android app has this. For example for email it's "fetch email every... 1 hour, 2 hours, ..., Push"Underglaze
True indeed! Presented like that, it looks pretty simple!Blockish

© 2022 - 2024 — McMap. All rights reserved.