Post

Replies

Boosts

Views

Activity

Can't kill background location app?
I'm working on an app that needs real-time location updates in the background, and while I've got it working, it seems like there's no way for users to actually kill the app. Swiping up on the multitasking screen looks like it's closing the app, but the app resumes instantly when I launch it (no splash screen or startup flow), and battery usage is still affected by the high-frequency location updates I'm requesting after I swipe up on it. Is there any way for me to allow users to actually kill the app via the multitasking screen the way they'd expect? While they could use the "Stop" button in my app to end location updates and save battery that way, I fear most users will just swipe up on it and then wonder why their battery is still draining fast.
1
0
349
May ’23
Any way to request that the GPS stays active, even in a low-motion situation?
I'm trying to create an application that keeps track of an anchored boat, and sounds an alarm if the boat moves outside of a certain radius (indicating the anchor is dragging instead of holding, or the boat is swinging around it to an undesirable location). However, right off the bat, I've got an issue retrieving the device's location: the latitude and longitude values stop changing when the device is sitting still on the slow moving boat. I'm setting desiredAccuracy to kCLLocationAccuracyBestForNavigation, but if I'm not holding the device in my hands, latitude and longitude updates stop coming in, and they won't come in regularly unless I pick up the device and rotate it around a little bit. It seems to me like the GPS is being put to sleep at the system level because it's detecting that the device isn't moving very fast, and accelerometer data doesn't look like an active user, but I need to override that somehow so my app can stay on top of a boat's real-time location. I've been able to reproduce this on multiple iOS devices, which is why I feel like something's going on at the system level, and isn't device-specific. Is there any way for me to work around this behavior (other than building a motorized tray to keep physically rotating the device, of course :D)?
3
0
803
Apr ’23