I am trying to create an application in which server will push updated/new data to the iPad whenever there's any change in the database(just like how the mail application works). I think APNS wont work in this scenario but i could be wrong. Can anyone suggest any good approach to get this functionality?
Asked
Active
Viewed 197 times
0
-
Build a type of 'service' in your app which would essentially be a timer on a repeated interval. Each interval could call some sort of web service on your server and will pull down any 'new' information. – Jeremy Oct 10 '12 at 15:25
-
1Mail clients have typically used polling rather than "push" logic. It allows them to be configured for update frequency. – Phillip Mills Oct 10 '12 at 15:26
1 Answers
0
You might find this wikipedia article about Push Technology interesting, specifically the section where it deals with "long polling". And you can have a sample implementation of long polling for ios here (also by having a look at this other post).
On the other hand, you might well try and use APNS so that the server notifies the app when new data is available, then the app (possibly after some user interaction) can get the new data.
-
Thanks @sergio for the answer. So that means there's no way real push can work in this scenario? If thats the case i think i will go with long polling because APNS wont fit in with what i am working on.. – AJT Oct 10 '12 at 15:58
-
1Glad to have helped. You are right, and the reason why I linked the wikipedia article is that it explains that "push" is not really push (as opposed to poll): there is always some communication started by the client, which the server handles in a particular way. Imagine: you are behind a firewall: no real push will ever be possible... so "push" is just "tech marketing", I fear... – sergio Oct 10 '12 at 16:34