How to resume NSURLSession download process after app force-quit and app relaunch?

前端 未结 3 1940
傲寒
傲寒 2021-02-02 13:00

I have implemented NSURLSession for downloading fairly large files from our servers. Now as long as I\'m working in foreground or background and go back to the app

3条回答
  •  盖世英雄少女心
    2021-02-02 13:47

    I think that after your application did force-quit you should start all over again (.

    If the user terminates your app, the system cancels any pending tasks.

    and

    When all of the tasks associated with a background session are complete, the system relaunches a terminated app (assuming that the sessionSendsLaunchEvents property was set to YES and that the user did not force quit the app)

    https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html

提交回复
热议问题