Upload progress issue with NSFileProviderExtension

I have implemented NSFileProviderExtension and observed that Upload progress is not shown most of the time.

The following error is reported by File Provider when trying to register the upload session to it.


[default] [ERROR] Failed registering URL session task <__NSCFBackgroundUploadTask: 0x105fd5890>{ taskIdentifier: 4 } with item item_Identifier_string; The file doesn’t exist.

FileProviderExtension UploadTask: <__NSCFBackgroundUploadTask: 0x105fd5890>{ taskIdentifier: 4 }, Error:The file doesn’t exist.


I have verified the item existance at path before and after this error is reported.

And during the upload period, item upload status is shown as "Waiting to upload" and once upload completes it shows the item details (Name, size and date).


I create a background upload task and try to register it with NSFileProviderManager and on completion block I resume the session.

[[NSFileProviderManager defaultManager] registerURLSessionTask:task forItemWithIdentifier:identifier completionHandler:^(NSError * _Nullable error) {

[task resume];

}]



I have similar implementation for downlaod task but it works fine.

Please let me know if any one have an idea to fix this issue.

Replies

Are you able to show uploading file progress using background configuration session ?


I have tried making background session for downloading file and it's working file while downloading

but when i tried same steps for uplaodig it doesn't show any progress there


i have tried your way to register task but not getting any such error.


I am using Alamofire by the way.


Thanks if you please help me in this ?