我不断收到错误消息
\n\n\n\n
No task request with identifier <decode: missing data> has been scheduled
在我的调试器输出中,所以我决定尝试运行 Apple 提供的示例代码,并得到了相同的错误。我已经尝试了多台计算机和 Xcode 版本、来自不同来源的多个示例项目,但没有任何效果。
\n我的 AppDelegate.swift 文件:
\nimport UIKit\nimport Firebase\nimport BackgroundTasks\n\n@main\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n \n func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {\n \n FirebaseApp.configure()\n \n BGTaskScheduler.shared.register(forTaskWithIdentifier: \xe2\x80\x9credacted.identifier\xe2\x80\x9d, using: nil) { task in\n self.handleAppRefresh(task: task as! BGAppRefreshTask)\n }\n \n return true\n }\n \n func applicationDidEnterBackground(_ application: UIApplication) {\n BGTaskScheduler.shared.cancelAllTaskRequests()\n scheduleAppRefresh()\n }\n \n func scheduleAppRefresh() {\n …Run Code Online (Sandbox Code Playgroud)