setLastKnownLocationPersistent method

LocationEngineStatus setLastKnownLocationPersistent(
  1. bool persistent
)
override

On Android devices this enables or disables saving of last known location so that it persists across application sessions. By default persistent saving across sessions is enabled. Set persistent to true to enable last known location to persist across application sessions, or false to disable it. When calling this method then LocationEngineStatus.ok is returned.

On iOS devices this is not supported and the value is stored, by default, across sessions. When calling this method then LocationEngineStatus.notSupported is returned.

Implementation

LocationEngineStatus setLastKnownLocationPersistent(bool persistent)  {
  if (Platform.isAndroid) {
    return _location.setLastKnownLocationPersistent(persistent);
  }
  return LocationEngineStatus.notSupported;
}