mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-18 14:23:42 +00:00
feat: Background download on iOS (#1442)
This commit is contained in:
1 parent
9d3221ebbb
commit
99924296ef
14 files changed
+383
-26
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user