feat: Background download on iOS (#1442)

This commit is contained in:
Afterain authored and GitHub committed 2026-08-18 18:08:53 +08:00
1 parent 9d3221ebbb
commit 99924296ef
14 files changed
+383 -26

No files matched your search

+28
View File
@@ -32,6 +32,34 @@ import Libgopeed
}
})
let locationChannel = FlutterMethodChannel(
name: "gopeed/location_keep_alive",
binaryMessenger: controller.binaryMessenger
)
locationChannel.setMethodCallHandler {
(call: FlutterMethodCall, result: @escaping FlutterResult) in
switch call.method {
case "requestPermission":
LocationKeepAliveManager.shared.requestPermission { authorized in
result(authorized)
}
case "start":
LocationKeepAliveManager.shared.start()
result(nil)
case "stop":
LocationKeepAliveManager.shared.stop()
result(nil)
default:
result(FlutterMethodNotImplemented)
}
}
GeneratedPluginRegistrant.register(with: self)
SwiftFlutterForegroundTaskPlugin.setPluginRegistrantCallback(registerPlugins)