isPowerSaveMode property

Future<bool> get isPowerSaveMode

Fetches the state of the operating-system's "Power Saving" mode.

Power Saving mode can throttle certain services in the background, such as HTTP requests or GPS.

NOTE: You can listen to changes in the state of "Power Saving" mode from the event BackgroundGeolocation.onPowerSaveChange.

iOS

iOS Power Saving mode can be engaged manually by the user in Settings -> Battery or from an automatic OS dialog.

Android

Android Power Saving mode can be engaged manually by the user in Settings -> Battery -> Battery Saver or automatically with a user-specified "threshold" (eg: 15%).

Example

bool isPowerSaveMode = await DeviceSettings.isPowerSaveMode;

Implementation

static Future<bool> get isPowerSaveMode async {
  return (await _methodChannel.invokeMethod<bool>('isPowerSaveMode'))
      as FutureOr<bool>;
}