AppDelegate.swift 559 B

1234567891011121314151617
  1. import Flutter
  2. import UIKit
  3. import BackgroundTasks
  4. @main
  5. @objc class AppDelegate: FlutterAppDelegate {
  6. override func application(
  7. _ application: UIApplication,
  8. didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  9. ) -> Bool {
  10. GeneratedPluginRegistrant.register(with: self)
  11. BGTaskScheduler.shared.register(forTaskWithIdentifier: "com.shishi.dingwei.refresh", using: nil) { task in
  12. // 处理后台任务
  13. }
  14. return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  15. }
  16. }