isIgnoringBatteryOptimizations method
Returns true if the app is already exempt from Android battery optimizations. Some OEMs kill foreground services otherwise.
Implementation
@override
Future<bool> isIgnoringBatteryOptimizations() async {
return await _channel.invokeMethod<bool>('isIgnoringBatteryOptimizations') ?? false;
}