Reputation: 3124
I am developing an app on the iOS platform which would involve a lot of iPads simultaneously working on a file on a server, using online collaboration like in google docs. However, it needs to update in realtime. Therefore, I think the best way to do this would be for the server to communicate with each iPad every time there is a change in the document.
Unfortunately, to my knowledge, the only way for a server to communicate with an iPad is if the iPad first requested info from the server (HTTP GET or POST). Since I want realtime updating, and I don't want the iPad asking the server every nanosecond whether ether is an update, this doesn't work.
How can I program the server to communicate with the iPad without first requiring a request from it? All help is greatly appreciated.
Upvotes: 0
Views: 632
Reputation: 118651
Just keep an open socket to the server from each iPad. Every time the app restarts, reestablish the connection. While the connection is down, queue up any changes.
No big deal. No rocket science here.
Upvotes: 0
Reputation: 11452
Check this out, Apple's push notification service
http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12
or much more relevant to your question,
COMET (server push to client) on iPhone
Upvotes: 2