From 205d83189004177a6cadac8478409c44612dee30 Mon Sep 17 00:00:00 2001 From: Codel1417 Date: Sat, 25 Jan 2025 19:19:31 -0500 Subject: [PATCH] remove [weak self] from method channel --- .../ios/Classes/SwiftPedometerPlugin.swift | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/packages/pedometer/ios/Classes/SwiftPedometerPlugin.swift b/packages/pedometer/ios/Classes/SwiftPedometerPlugin.swift index 4c67ab89d..b95ac0c6a 100644 --- a/packages/pedometer/ios/Classes/SwiftPedometerPlugin.swift +++ b/packages/pedometer/ios/Classes/SwiftPedometerPlugin.swift @@ -18,7 +18,7 @@ public class SwiftPedometerPlugin: NSObject, FlutterPlugin { let methodChannel = FlutterMethodChannel(name: "com.example.pedometer", binaryMessenger: registrar.messenger()) methodChannel.setMethodCallHandler({ - [weak self] (call: FlutterMethodCall, result: FlutterResult) -> Void in + (call: FlutterMethodCall, result: FlutterResult) -> Void in // This method is invoked on the UI thread. guard call.method == "isStepDetectionSupported" || call.method == "isStepCountSupported" else { result(FlutterMethodNotImplemented) @@ -33,17 +33,6 @@ public class SwiftPedometerPlugin: NSObject, FlutterPlugin { } }) } - private func receiveBatteryLevel(result: FlutterResult) { - let device = UIDevice.current - device.isBatteryMonitoringEnabled = true - if device.batteryState == UIDevice.BatteryState.unknown { - result(FlutterError(code: "UNAVAILABLE", - message: "Battery level not available.", - details: nil)) - } else { - result(Int(device.batteryLevel * 100)) - } - } } /// StepDetector, handles pedestrian status streaming