GoMap icon indicating copy to clipboard operation
GoMap copied to clipboard

Can't record location with screen off

Open verhovsky opened this issue 1 year ago • 7 comments

When I enable recording GPX tracks with the screen off and then shut my screen off (well, dim the screen, newer iphone displays are always on), I see the widget for a brief second with a menu asking me if i want to allow it to record my location when the screen is off, but I can't press accept. As soon as I un-dim the screen the widget disappears. I tried disabling the always on display by turning on batter saver mode but then I just don't see the lock screen widget at all.

verhovsky avatar Jan 30 '25 01:01 verhovsky

In iOS 18.3 I’m seeing some odd things about background tasks but I don’t see the behavior you experience. It asks permission in the widget but I’m able to press it. Oddly it also allows me to record in the background even if I have Location access set to “While using” and not “Always”.

Can you post a video of the behavior you see?

bryceco avatar Jan 30 '25 16:01 bryceco

The prompt says "Allow Live Activities from Go Map!! Debug?" and it actually disappears on its own automatically, before I un-dim the screen. This is running the latest commit on iOS 18.3 on an iPhone 15 Pro, I see the issue on the official test flight app as well and I've had this bug ever since you introduced this widget.

image

Changing Location from While Using to Always doesn't help.

I sent you an email.

verhovsky avatar Jan 30 '25 22:01 verhovsky

Do you have notifications turned off?

bryceco avatar Jan 31 '25 01:01 bryceco

No, they're on.

image

image

verhovsky avatar Jan 31 '25 01:01 verhovsky

Seems I accepted the widget popup too many times and now it doesn't ask me any more, even after deleting the app and reinstalling from the App Store. Not sure how to replicate it.

bryceco avatar Jan 31 '25 02:01 bryceco

Try toggling/disabling the Live Actions setting for the app?

verhovsky avatar Jan 31 '25 06:01 verhovsky

Good idea! That enables/disables widgets but it still doesn’t give me the prompt.

bryceco avatar Jan 31 '25 07:01 bryceco

This bug happens when you have GPX Tracks set to off. Setting it to on let me press accept on the lock screen.

It's not possible to center the screen, lock your screen and have the map still centered unless you're recording GPX Tracks

verhovsky avatar Mar 07 '25 01:03 verhovsky

Oh, yes. That’s how it has always been. To record in the background GPX Tracks has to be enabled as well as well as Collect in background

bryceco avatar Mar 07 '25 01:03 bryceco

But I should be able to not lose my location just because I turned the screen off

To record in the background

I'm not recording a track, I just want the map to stay centered on my current location when I lock and unlock my phone. There's no reason to stop tracking my current location because I locked the screen if I've given the app full location permissions. I think I would've noticed earlier if it always worked this way, but you know more than me of course, I haven't looked at the code.

verhovsky avatar Mar 07 '25 03:03 verhovsky

I can recreate the original bug report now (seeing the Live Activities popup but not being able to interact with it). Since current behavior is to not record in the background when GPS Tracks is disabled there shouldn't be a pop-up at all.

I'm not recording a track,

Nit-pick: The app is rather unconventional (and maybe counterintuitive) on this point, but any time you have GPS enabled it's recording a track. The GPS Tracks button only controls whether the tracks are displayed. What this means is that if you're walking around with GPS turned on and GPS Tracks disabled, and then much later enable GPS Tracks, you'll be able to see where you previously walked.

I just want the map to stay centered on my current location when I lock and unlock my phone.

This is similar to #705. My preferred solution would be to automatically re-enable GPS if it was enabled when locked and the amount of time has been less than 10 minutes or so. What do you think?

bryceco avatar Mar 07 '25 19:03 bryceco

This commit fixes the issue of displaying the Live Activity popup when the app enters the background. It doesn't fix #705 or address your desire to keep GPS enabled when in the background and not displaying tracks.

bryceco avatar Mar 08 '25 23:03 bryceco

automatically re-enable GPS if it was enabled when locked

that's exactly what I expect to happen. And no need to add the 10 minute timer. I'll disable GPS tracking if I want to.

verhovsky avatar Mar 08 '25 23:03 verhovsky

2210418a785ec510d2fbd58ba673290a2bb45753 adds support for restarting GPS automatically.

bryceco avatar May 13 '25 21:05 bryceco