It's not clear from the documentation, but it looks like this function does 2 different things:
1. sets the device to use (or disable) the GNSS chip with the given options (i.e: GPS Only vs Multi system, etc)
2. the above + sets the callback for position events
I know there is a general confusion about how to disable GNSS, and some examples pass the method(:onPosition) even there, though it was confirmed by Garmin that it's not used when options is LOCATION_DISABLE, so it makes more sense to pass null for the callback.
class HikerApp extends App.AppBase {
function onStart(state as Dictionary?) as Void {
Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, method(:onPosition));
}
function onPosition(info as Position.Info) as Void {
}
function onStop(state) {
Position.enableLocationEvents(Position.LOCATION_DISABLE, null);
}
}Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, null);<iq:uses-permission id="Positioning"/> in my manifest).