Right now I am just asking the server every 3 seconds to find out if there are any new messages using NSURLRequest, etc. If there is, he saves them in the database and sends an NSNotificationCenter notification, if not, then he just waits 3 seconds and retries.
Is this the best way to do this? I understand (compose messages here and information elsewhere) that opening a permanent connection to the server is tedius and not recommended, so what is the best way to do this?
My main concern is that if new messages are not loaded with an empty (with information, but still a few bytes) XML feed, and starting it every 3 seconds will eventually add up and use a lot of data.
Any pointers would be much appreciated.
thank
source
share