我的 iPad 应用程序如何订阅 RESTful Web 服务以便自动更新?
我正在寻找方法,让我的 RESTful Web 服务可以让我的 iPad 应用程序知道在服务器数据更新时更新其缓存数据。服务器运行在 Tomcat 上阿帕奇泽西岛。
这可行吗?并且不使用 Apple 推送通知 (APN)?
I am looking for ways where my RESTful web service can let my iPad app know to update its cached data when the server's data has been updated. The server is running on Tomcat & Apache Jersey.
Is this doable? And not using Apple Push Notification (APN)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
本质上有两个选项:从应用程序到服务器的心跳检查(在计时器上)或保持通信线路开放的东西,例如网络套接字。这是一个适用于 iOS 的开源 Web 套接字,但我还没有亲自尝试过它:
http: //code.google.com/p/unitt/wiki/UnittWebSocketClient
There are essentially two options: heartbeat check from the app to the server (on a timer) or something that keeps the line of communication open, such as web sockets. Here is an open source web socket for iOS, but I have not personally experimented with it:
http://code.google.com/p/unitt/wiki/UnittWebSocketClient
我不知道你为什么要避开 APN,但这听起来确实像是它的用途。
如果您只想在应用程序运行时更新,还有其他选项(想到的是直接轮询),但如果您希望即使应用程序未运行时也通知用户,则实际上没有任何其他选项苹果批准了这样做的方式。
I'm not sure why you want to avoid APN, but this really sounds like what it's made for.
If you want to update only when your app is running, there are other options (straight forward polling comes to mind), but if you want the user to be notified even when the application isn't running, there isn't really any other Apple approved way to do it.
可以扭转设计并使您的设备成为客户端并定期从 REST 服务提取数据吗?凭借从 REST 获得的所有支持,了解您将完全控制设备何时从服务器提取数据以及确切地控制可能进入设备的数据可能会有所帮助。
我很想知道你的想法,谢谢。
Can reverse the design around and make your device a client and pull data from a REST service at a regular interval?? With all the support one gets from REST, it might be helpful to know you will have complete control of when data is being pulled by the device from server and exactly the data that might goto device.
I'm curious to know your thoughts, Thanks.
我很快就会构建一个网络同步 iOS 应用程序,我们将使用 RestKit。看看吧,也许会有很大的帮助。
I'll be building a web-syncing iOS application soon, and we're going to use RestKit. Take a look, it might be a big help.