0

from the next explanation about Background Execution from apple -

https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html

I am understood that it isn't possible to achieve the next thing : Get the user location in the background and send this received data to google place nearby API (also in the background).

And the main question is how and if it possible to achieve that.

Thanks for your help!

kbok
  • 31
  • 1
  • 7
  • It should be possible. I believe since iOS 7 the max time for the background task is 3 minutes. If this is enough to get current location and post data, you should be fine. Don't forget to assign corresponding values to UIBackgroundModes – CryingHippo Jun 17 '16 at 17:32
  • excellent but I need to run this process for ever, and this is not possible in the way you suggest. – kbok Jun 17 '16 at 17:41
  • You can use background Modes : Locations updates, don't forget to add NSLocationAlwaysUsageDescription to plist and call requestAlwaysAuthorization + startMonitoringSignificantLocationChanges – CryingHippo Jun 17 '16 at 17:46
  • This will give you update for location changes in 500 meters and once per 5 minutes. – CryingHippo Jun 17 '16 at 17:49
  • Another possible solutions could be the use of Background fetch – CryingHippo Jun 17 '16 at 17:50
  • http://stackoverflow.com/questions/36148589/run-a-swift-2-0-app-forever-in-background-to-update-location-to-server?rq=1 – CryingHippo Jun 17 '16 at 17:55
  • Ok for the location updates in the background I don't have problem but now how can I integrate with the data from the location and the google place nearby api in the background also ? This process will be close or not ? can you explain me ? Thanks – kbok Jun 17 '16 at 17:57
  • my main goal is to integrate with server in the background when the location changed – kbok Jun 17 '16 at 17:58
  • I never worked with the google places api, but I believe it's some kind of POST request ? You probably just form POST request with coordinates you've received and you are good to go. – CryingHippo Jun 17 '16 at 18:00
  • Thank you for your help!. I will try to apply this for my work, hope to succeed !. – kbok Jun 17 '16 at 20:28

0 Answers0