iOS-Open-GPX-Tracker icon indicating copy to clipboard operation
iOS-Open-GPX-Tracker copied to clipboard

iOS 13.5.1: Background tracking not working

Open eliabieri opened this issue 4 years ago • 16 comments

I updated my iPhone 7 from iOS 13.3.1 to iOS 13.4 and now the tracking is not continued when I lock my phone.

eliabieri avatar Mar 25 '20 14:03 eliabieri

Hi @eliabieri,

Have you checked the location privacy setting again in the Settings app? Just trying to eliminate any possibilities. Regardless, I personally have yet to upgrade to iOS/iPadOS 13.4 on any of my devices yet, so I can't currently test.

Also, does it happen often, all the time, or occasionally when it doesn't track while locked?

Does the tracking go pause, or missing track points / or does the app just 'quits all together', leaving you with the crash recovery dialog when reopen?

Vincent

vincentneo avatar Apr 02 '20 16:04 vincentneo

Hey Vincent, I checked and my location setting is set to „always“. Also, it happens every time and it just does not record any locations while in background or when the phones is locked. When I bring the app back into foreground, the tracking resumes. Sometimes, random positions are added when the app goes in the background. I hope this information helped finding the issue. I gladly provide more information if needed.

eliabieri avatar Apr 02 '20 16:04 eliabieri

Hi @eliabieri,

So it sounds like iOS isn't providing the app the location data when app is suspended.

I will search around, in case it's a iOS 13.4 thing, as I currently can't think of a possible fix, with those symptoms that you provide. (unless there is yet another API change)

Vincent

vincentneo avatar Apr 03 '20 15:04 vincentneo

Update: I was able to resolve the issue by changing the location access from „always“ to „when using the app“ and then back to „always“. Seems like the app lost the permissions to query the locations while it‘s in the background. Feel free to close the issue. Time will tell if other users experience the same problem as I did. Thanks for the help.

eliabieri avatar Apr 03 '20 15:04 eliabieri

Hi @eliabieri,

Thanks for the heads up! Looks like Apple's fooling around with us consumers again...

vincentneo avatar Apr 03 '20 15:04 vincentneo

Can we reopen this issue? I'm having the same problem on an iPhone XS Max with iOS 13.5.1. I don't think this happened with iOS 13.5, but it started with iOS 13.5.1.

Every time my phone locks, GPX Tracker loses background tracking. I can unlock my phone 10 seconds later with the app still open, and the accuracy again starts at 300 feet or so, and then after several seconds it returns to the normal 25 feet or so. I changed the Location setting from "Always" to "While Using the App" and then back to "Always", but that hasn't made a difference.

I've noticed that in the Background App Refresh settings, there is no listing for GPX Tracker. Must there be, for it to work properly?

By the way, thanks for this app. I use it all the time.

mstonespeedy avatar Jun 17 '20 18:06 mstonespeedy

@mstonespeedy That does sound like a good reason to reopen and revisit the issue. Personally have yet to upgrade from 13.4.1, so I'm unable to test yet.

Does it only occur when locked? If you were to say, start a tracking, and use the phone for something else at around the same timeframe, does the loss of GPS occur also?

I don't recall the app being in the Background App Refresh settings, since I worked/known about on the app, so I doubt that is the cause of the issue.

vincentneo avatar Jun 18 '20 09:06 vincentneo

@vincentneo Thanks for reopening the issue.

I haven't yet seen it happen when the phone is unlocked with the app in the background. And in my testing today, I've seen the problem only half of the time, but a few times it maintained the location lock even with the phone locked.

One more thing. I usually use the app without a Wi-Fi connection, so I've only seen the problem when using a cellular network connection. I'm not sure if that's part of the issue or not.

mstonespeedy avatar Jun 18 '20 13:06 mstonespeedy

@vincentneo Perhaps adding the app to the Background App Refresh settings would help.

Also, this article looks useful:

https://developer.apple.com/documentation/corelocation/getting_the_user_s_location/handling_location_events_in_the_background

The Overview starts with this:

"Most location services are meant to be used while your app is in the foreground, but some can also run in the background or even cause your app to be launched. To receive events in the background, configure the Location updates capability for your app in Xcode, as shown in Figure 1. You must also set the allowsBackgroundLocationUpdates property of your CLLocationManager object to true."

mstonespeedy avatar Jun 18 '20 14:06 mstonespeedy

@mstonespeedy,

The article you've shared is very interesting: the project, as is, already has both the checkbox checked as shown in Figure 1 of the link, and has allowBackgroundLocationUpdates set to true too. Yet, in the Settings app, I am not seeing Background App Refresh settings, and that I have just assume that it was never enabled.

"Note Disabling the Background App Refresh setting for the current app, or for all apps, does not prevent the delivery of location events in the background." from the article seems to also suggest that it isn't potentially useful either? I am confused.

Based on the article, I think it's fair to now assume that Background App Refresh is enabled? Not sure why its not showing up in my settings. Not sure if its only my device too 😬.

Frankly, I do not know how to solve this issue. I hope it's not Apple trying to clamp down with their privacy stuff again, or some obscure bug yet again.

vincentneo avatar Jun 21 '20 11:06 vincentneo

I tried today the app in background with iOS 13.5.1, used cell network and wifi off, more than 2h session and I had no issues...

merlos avatar Jun 22 '20 00:06 merlos

The app doesn't appear in my Background App Refresh settings either. Does it appear for anyone? Does the project need to be updated to the latest version of Xcode and the iOS toolkit, to avoid issues with the latest versions of iOS?

@merlos Thank you for testing. I tested briefly today and had no problems. I'll report back when I see it again, and hopefully gather more details.

mstonespeedy avatar Jun 23 '20 02:06 mstonespeedy

Does the project need to be updated to the latest version of Xcode and the iOS toolkit, to avoid issues with the latest versions of iOS?

Considering how this issue is hardly replicable and not widespread meant that the above is probably a no.

Anyways, when you had the issue is Low Power Mode off or on?

vincentneo avatar Jun 23 '20 14:06 vincentneo

Considering how this issue is hardly replicable and not widespread meant that the above is probably a no.

With which version of the iOS toolkit is this project built? Shouldn't it use the latest version regardless of this issue?

Anyways, when you had the issue is Low Power Mode off or on?

Good question, but Low Power Mode was definitely off. I never use that.

mstonespeedy avatar Jun 23 '20 16:06 mstonespeedy

Does it appear for anyone?

It does not appear for me.

PS: Thanks for developing this! I have hopes of tweaking it to use as a mileage tracker for myself, but I’m still pretty new to Swift and trying to pick up SwiftUI right now...

Azhrei avatar Jun 30 '20 07:06 Azhrei

Hi

I have worked on background task before but they don't suggest it.

Repository: https://github.com/cmlcrn17/Swift5-BackgroundTaskNotification (Not update sorry but I will updating soon)

https://www.andyibanez.com/posts/modern-background-tasks-ios13/ https://www.theverge.com/2019/10/31/20942043/apple-ios-13-iphone-11-pro-ram-memory-management-app-background-refresh https://developer.apple.com/documentation/backgroundtasks/starting_and_terminating_tasks_during_development

cmlcrn17 avatar Jul 22 '20 09:07 cmlcrn17

Closing issue as it may no longer apply.

merlos avatar Jun 01 '23 12:06 merlos