iOS: Does force quitting the app disables background upload using NSURLSession?

后端 未结 2 492
失恋的感觉
失恋的感觉 2020-12-09 04:02

The question is around NSURLSession and NSURLSessionUploadTask.

I\'m uploading large files to server and noticed that when I

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-09 04:46

    I can confirm now after a bunch of testing that background task will run ok if the app is just put into background. However, if user force quit the app manually, then iOS cancels all scheduled background tasks. So next time the app is launched I'm getting all the callbacks to the delegate with the error code of a canceled task.

    Hope it helps someone looking into the same thing.

提交回复
热议问题