Skip to content

Commit 9597aab

Browse files
authored
fix(battery_plus): batteryMonitoringEnabled should be set false when cancel on iOS (#3634)
1 parent 2aa9f7e commit 9597aab

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

packages/battery_plus/battery_plus/ios/battery_plus/Sources/battery_plus/FPPBatteryPlusPlugin.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ - (FlutterError *)onListenWithArguments:(id)arguments
114114

115115
- (FlutterError *)onCancelWithArguments:(id)arguments {
116116
[[NSNotificationCenter defaultCenter] removeObserver:self];
117+
[[UIDevice currentDevice] setBatteryMonitoringEnabled:NO];
117118
_eventSink = nil;
118119
return nil;
119120
}

0 commit comments

Comments
 (0)