OneDrive / onedrive-sdk-ios

OneDrive SDK for iOS
https://dev.onedrive.com
Other
100 stars 88 forks source link

Background mode? #162

Closed gerchicov-bp closed 7 years ago

gerchicov-bp commented 7 years ago

Could you explain how to allow download in background with this sdk? I mean exactly downloading in background, not resuming download when app enters foreground.

As I understand I use (and your documentation recommend to use code from ODClient+DefaultConfiguration.h but I need to edit this configuration to use background mode instead of default one

kevklam commented 7 years ago

Background download isn't currently supported by the SDK. It should be possible to override the httpprovider in the DefaultConfiguration with one created using a custom NSURLSessionConfiguration, however if the app is terminated and then relaunched via application:handleEventsForBackgroundURLSession:completionHandler:, then even though you can re-create a new ODUrlSessionManager with the correct configuration, it will have lost necessary state i.e. the dictionary of completion blocks for all outstanding tasks.