My application reads photos and videos available in Camera Roll, using PHAssetResource
application is fetching the original photo and video data. Below is the code used to retrieve the data from Camera Roll.
for (PHAssetResource *resource in copyResources)
{
PHAssetResourceRequestOptions *options = [PHAssetResourceRequestOptions new];
options.networkAccessAllowed = allowCloud;
PHAssetResourceDataRequestID requestID = [[PHAssetResourceManager defaultManager] requestDataForAssetResource:resource options:options dataReceivedHandler:^(NSData *data) {} completionHandler:^(NSError *requestError) {}
}
Sometimes original asset fetch is getting failed,and completion handler gets called with error
Error Domain=NSCocoaErrorDomain Code=-1 "(null)"
I have no info why this is failing. Can you please provide some suggestions to overcome this issue.