|
|
@@ -1,5 +1,6 @@
|
|
|
import Flutter
|
|
|
import UIKit
|
|
|
+import BackgroundTasks
|
|
|
|
|
|
@main
|
|
|
@objc class AppDelegate: FlutterAppDelegate {
|
|
|
@@ -8,6 +9,9 @@ import UIKit
|
|
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
|
|
) -> Bool {
|
|
|
GeneratedPluginRegistrant.register(with: self)
|
|
|
+ BGTaskScheduler.shared.register(forTaskWithIdentifier: "com.shishi.dingwei.refresh", using: nil) { task in
|
|
|
+ // 处理后台任务
|
|
|
+ }
|
|
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
|
|
}
|
|
|
}
|