Skip to content

Commit

Permalink
remove [weak self] from method channel
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Jan 26, 2025
1 parent bf078eb commit 205d831
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions packages/pedometer/ios/Classes/SwiftPedometerPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 205d831

Please sign in to comment.