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)?

Accepted Answer

After posting this I tried one more thing, and it seems to be working!

I tried the various location manager "activityType" values, and while most of them allow the location to sleep, it seems like "airborne" requests high priority location data, even for low-speed things like runway taxiing.

With that activityType set, I'm now getting consistent location updates, even with subtle boat movements.

Do you have pausesLocationUpdatesAutomatically set?

If you don’t know - you do have it set; the default is enabled, to the surprise of everyone who discovers it.

I keep getting location updates, but the updates contain the exact same lat/long even though I'm slowly moving

That’s probably because you’re using one of the activity types where Apple snaps your location to roads, or similar, in order to get tidier lines on the screen.

I use the running/hiking/ activity type (forget the exact name) for everything; it’s the least messed-about.

P.S. Don’t post comments, post replies. Comments don’t seem to generate email notifications.

Any way to request that the GPS stays active, even in a low-motion situation?
 
 
Q