| 1234567891011121314151617 |
- import Flutter
- import UIKit
- import BackgroundTasks
- @main
- @objc class AppDelegate: FlutterAppDelegate {
- override func application(
- _ application: UIApplication,
- 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)
- }
- }
|