[iOS 10 - NSURLSession] Unable to create a resumed download task from resume data
| Originator: | lipovacjetu | ||
| Number: | rdar://27766293 | Date Originated: | 9.8.2016, |
| Status: | Open | Resolved: | - |
| Product: | iOS SDK | Product Version: | |
| Classification: | Reproducible: | Always |
Summary: App is unable to resume a previously interrupted download task. (Session is created with backgroundSessionConfiguration) If the app gets terminated while download task is in progress, NSURLSessionTaskDelegate gets called and it receives the error with download task resume data. App stores the received data and then tries to create a download task using -[NSURLSession downloadTaskWithResumeData:]. Error received: *** -[NSKeyedUnarchiver initForReadingWithData:]: data is NULL Task gets created but most of it's properties are not set, for instance currentRequest or originalRequest. That results in this error: Invalid resume data for background download. Background downloads must use http or https and must download to an accessible file. Steps to Reproduce: 1. Create a project for an app that uses background download with NSURLSession 2. Start downloading a file 3. Manually terminate the app before the download 4. Try to recreate a download task using resume data received in the - [URLSession: task:didCompleteWithError:] method Expected Results: Task to resume download is created and previous download continues, as it does when the app is running on iOS9. Actual Results: -[NSURLSession downloadTaskWithResumeData:]. Error received: *** -[NSKeyedUnarchiver initForReadingWithData:]: data is NULL Task gets created but most of it's properties are not set, for instance currentRequest or originalRequest. That results in this error: Invalid resume data for background download. Background downloads must use http or https and must download to an accessible file. Version: iOS 10.0 (14A5322e) Configuration: iPhone 6s, WiFi
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!