isIgnoringBatteryOptimizations property
Returns true
if device is ignoring battery optimizations for your app.
In most cases, the Background Geolocation SDK will perform normally with battery optimizations.
bool isIgnoring = await DeviceSettings.isIgnoringBatteryOptimizations;
Implementation
static Future<bool> get isIgnoringBatteryOptimizations async {
return (await _methodChannel.invokeMethod<bool>(
'isIgnoringBatteryOptimizations')) as FutureOr<bool>;
}