I wrote a basic location tracking application that will run in the background. (Not only the background stream, but when the device is dark.) I have a set of UIBackgroundModes keys, and this part works by beautifully recording places on the screen.
Then I need to process these locations. Based on location and some other criteria, the application will sometimes need to send some information to the server through an HTTP receive or publication. There are several problems:
Messages must be sent to the server, even if the application is in the background.
Messages must be sent to the server even if the device is disconnected when a message is generated (users will often be out of range of cells, receiving a gps location). Of course, messages should not be sent immediately, but they should be stored and sent when the device is reconnected to the network.
If the message does not make it the first attempt, it must be resent several times before giving up.
I am looking for help in planning how to handle these three things.
The app will target iOS6 +.
I am a new iOS developer, but I developed a very similar application for Android. I am looking for general tips and strategies, not code if it is no longer there. I just don't know iOS / Objective C well enough to find out if there are already classes or frameworks to handle this or help with its aspects. I saw many examples of "How to send data to the server", this is not what I am looking for. Instead, I would like to point out pointers for which classes or systems can help manage re-connections / commands, how to handle this in the background, etc. It is also helpful to warn of issues that need to be addressed. Thanks so much for any advice.
source share