小编Con*_*ous的帖子

尝试使用 BGAppRefreshTask 并收到错误没有安排带有标识符 <解码:丢失数据> 的任务请求

我不断收到错误消息

\n
\n

No task request with identifier <decode: missing data> has been scheduled

\n
\n

在我的调试器输出中,所以我决定尝试运行 Apple 提供的示例代码并得到了相同的错误。我已经尝试了多台计算机和 Xcode 版本、来自不同来源的多个示例项目,但没有任何效果。

\n

我的 AppDelegate.swift 文件:

\n
import 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)

xcode ios swift

12
推荐指数
3
解决办法
3579
查看次数

标签 统计

ios ×1

swift ×1

xcode ×1