1

Our app is fitness-related. It uses location services in the background. The user clicks a button when the app is in foreground and then we trigger startUpdatingLocation. We initially set the accuracy to kCLLocationAccuracyNearestTenMeters (force GPS) and distance filter to 1500. After that the user locks the screen and put the mobile in a pocket.

The problem is that this doesn't work for 5-10% of our ios users (it works perfectly for the rest). We have logged when the location update event occur and we can see that it doesn't trigger. When the user clicks the button in the foreground we also setup a timer to trigger x minutes later and the timer does not trigger either (for the users it doesn't work for).

We have not been able to reproduce the issue in-house, so it's hard to do good troubleshooting.

I know that the OS can terminate the app if the user is using other apps in the foreground, but from what I understand it may call applicationWillTerminate and we have not seen any logs from that event being called. However it still might be the case that the OS decides to terminate our app. If that is the case, what can we do about it? Our app is wanted by the user and starting another app (for example taking a photo) does not mean that the user want our app to stop working. So the question now is if it's related to that OS terminates our app, is there anything we can do?

Notes:

  • pausesLocationUpdatesAutomatically is to NO
  • Background App Refresh is enabled
  • We have not enabled gps or location-services in UIRequiredDeviceCapabilities (plist) since our app can be used in two ways. With or without GPS.
  • We require "always on"-setting to be enabled when the user clicks the button in the foreground.
  • We have confirmed that backgroundTimeRemaining property returns the max value (indicating that the app is allowed to run in the background indefinitely)
  • The problem occur for a variety of ios versions both 8.x and 9.x.
Community
  • 1
  • 1
corpat
  • 53
  • 4
  • Did you ever find a solution to this? I think I am seeing the same thing in my app. I record a users location while they hike. For a few users there will be a gap in their data in the middle of the hike. Location recording was working fine in my app for 2 years and then this started happening. I can't figure it out. – Stephen Johnson Jan 03 '17 at 23:23
  • I think this post may have the answer. http://stackoverflow.com/questions/17484352/iphone-gps-in-background-never-resumes-after-pause – Stephen Johnson Jan 03 '17 at 23:46

0 Answers0