0

We've developed a simple tracker application for iOS, which gather GPS data and sent it to server. But ran into a problem: our tracker asleep after 30-60 minutes of work, and do not gps data sending. When it activates on screen - nothing looks wrong, data sending process resuming. Background work we do according this instruction: https://medium.com/@icodeinswift/location-permissions-in-ios-apps-always-or-when-in-use-371c1b22e02e

I not a specialist in iOS, but our iOS developers has no idea whats going wrong, I want to help them with ideas. What may going wrong?

Update Similar question on stackoverflow (maybe with solution - not check yet): iOS GPS tracking app that runs all the time

  • You need to edit your question to show relevant code. Do you enable location updates before your app enters the background? Do you have significant location updates enabled? How do you initialise your location manager? – Paulw11 Feb 19 '19 at 08:27
  • How its linked with background work? I think I can change geotracking process with something else - playing music - and will stumbled with the same issue. I don't ask about searching of error in code, but I'm interesting in pattern of right realisation of background work. – Alexander Fedyukov Feb 19 '19 at 08:36
  • You cannot keep tracking the location continuosly even when your app is in background, there is a BackgroundTask that can run for about 10 mintues and you can perform any task in this background task. But it will not run forever, one thing that can be done is there is an option that opens your app if there is a significant change in the user's location. like 500 meters. – Shahzaib Qureshi Feb 19 '19 at 09:13
  • Location updates is one of the supported background modes, but you can only perform small amounts of work each time you get a location update. There is no general purpose background mode on iOS. You need to show some code in order for us to help you as to whether you are doing the right thing or not. – Paulw11 Feb 19 '19 at 09:17
  • @ShahzaibQureshi It looks good! Thank you. Do you have more ideas? – Alexander Fedyukov Feb 19 '19 at 09:17
  • He is referring to significant location updates that I already asked you about – Paulw11 Feb 19 '19 at 09:20
  • No mate, uptill now i have never come across a solution that continuosly tracks location while an app is terminated or is in background in iOS – Shahzaib Qureshi Feb 19 '19 at 09:22
  • But how ordinary fitness trackers works on iOS? – Alexander Fedyukov Feb 19 '19 at 09:24
  • don't know about them but the only way to track location is the significant changes one. – Shahzaib Qureshi Feb 19 '19 at 09:27
  • You can definitely track location in the background indefinitely using a combination of regular and significant location updates, but if you won't show your code we can't help. – Paulw11 Feb 19 '19 at 09:59
  • I've asked developer about code. Please wait. – Alexander Fedyukov Feb 19 '19 at 10:00
  • [Dhruv Sharma](https://www.linkedin.com/in/dhruvrsharma/) helps me with link to the similar [question](https://stackoverflow.com/questions/35515528/ios-gps-tracking-app-that-runs-all-the-time) – Alexander Fedyukov Feb 19 '19 at 10:07

0 Answers0