Skip to content

Commit 5e2d44c

Browse files
committed
fix batteryMonitoringEnabled should be set false when cancel
1 parent 2aa9f7e commit 5e2d44c

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)