长轮询VS苹果推送通知服务与; Android的C2DM [英] Long-polling vs Apple Push Notification Service & Android C2DM

查看:111
本文介绍了长轮询VS苹果推送通知服务与; Android的C2DM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立一个移动应用,具有一定的实时约束。所以我想谈谈计算器来获得建议和放大器;意见和企图决定哪个是更新应用程序的状态的最佳解决方案而运行:

  1. 在依靠长轮询或直接连接到我的服务器
  2. 在依靠苹果推送通知服务和Android C2DM

除了事实,APNS和C2DM提供统一的接口,而应用程序运行还是不推通知,可以说是一个定制的解决方案(基于长轮询或直接连接)更灵活,较少依赖于苹果&安培的等待时间; Android的队列。

据我所看到的,我想大多数的争论源于多少电池的消耗,以保持连接的成本比较开比开在智能手机上的连接。

我因此我在两件事情特别感兴趣的:

  • 在经验APNS和C2DM
  • 在保持打开TCP连接在智能手机上的所有含义
  • 详细信息。

引用的欢迎!谢谢!

解决方案
  

依赖于苹果&​​安培的等待时间;   Android的队列

我不认为这是真的。它是由应用程序开发者和服务器端实现多少时间这需要。我收到我的电子邮件推送到我的手机在我的浏览器客户端得到它。而且不只是Gmail的,我的企业电子邮件以及。

至于你的问题,你应该用什么最好的作品。甚至更好,你应该给用户使用推送通知或者设置轮询周期的选项。

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!

解决方案

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.

这篇关于长轮询VS苹果推送通知服务与; Android的C2DM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆