application:handleEventsForBackgroundURLSession:completionHandler:
上传在后台完成时不会运行。当所有上传/下载任务在后台完成后,iOS 应唤醒应用程序并调用上述方法。但事实并非如此。
我在这里错过了什么?谁能确认一下是否
handleEventsForBackgroundURLSession
在 iOS9.0 模拟器中工作还是我做错了什么?由于它不适用于 2 和 3 中给出的示例,所以我想也许我测试错了。
最佳答案
@ZayinKrige 在评论中回答了这个问题:
background download events don't fire on a simulator. You can only test this on a real device
为了扩展一点,这里有一个测试后台 session 代码的指南:
https://forums.developer.apple.com/message/42353#42353
关于ios - NSURLSession:handleEventsForBackgroundURLSession 方法不在后台 session 中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36071178/