My requirement is:
1) I have to send "device location" after every 3 hours to our server.
2) App may or may not be run while sending "device location" to the server.
For achieving this I found "significant-change location service" is suitable (supports from iOS 4.0 and later).
What I have done -
1) My Application Delegate is implementing CLLocationManagerDelegate.
2) From didFinishLaunchWithOptions: I am calling startMonitoringSignificantLocationChanges.
3) Implementing 2 delegate methods for successful location fix and its failure ie didUpdateToLocation: and didFailWithError:
What I am getting -
Each time I start the app I am getting my current location. Well at very first launch app asked me for allowing GPS fix from Settings.
I'm stuck on following points -
1) How to get new location after every 3 hours regardless of whether app is running or not.
2) How can I test this on my device. Do I need to physically move from one place to another for location change. Badly confused how to test the app.
3) When the service in background gets the new location what happens at that time, so that these new location I can send to my server. Please confirm.
If needed I can place full source code whatever I have written after googling.
1) I have to send "device location" after every 3 hours to our server.
2) App may or may not be run while sending "device location" to the server.
For achieving this I found "significant-change location service" is suitable (supports from iOS 4.0 and later).
What I have done -
1) My Application Delegate is implementing CLLocationManagerDelegate.
2) From didFinishLaunchWithOptions: I am calling startMonitoringSignificantLocationChanges.
3) Implementing 2 delegate methods for successful location fix and its failure ie didUpdateToLocation: and didFailWithError:
What I am getting -
Each time I start the app I am getting my current location. Well at very first launch app asked me for allowing GPS fix from Settings.
I'm stuck on following points -
1) How to get new location after every 3 hours regardless of whether app is running or not.
2) How can I test this on my device. Do I need to physically move from one place to another for location change. Badly confused how to test the app.
3) When the service in background gets the new location what happens at that time, so that these new location I can send to my server. Please confirm.
If needed I can place full source code whatever I have written after googling.