I´m accessing to photos library. All the methods accomplished.
Privacy - Photo Library Usage Description. This app requires access to the photo library
permission implemented as other permissions,
Then:
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
if (status == PHAuthorizationStatusAuthorized) {
PHFetchOptions *fetchOptions = [PHFetchOptions new];
fetchOptions.includeAssetSourceTypes=PHAssetSourceTypeCloudShared| PHAssetSourceTypeUserLibrary;
fetchOptions.predicate = [NSPredicate predicateWithFormat:@"mediaType = %d", PHAssetMediaTypeVideo];
_fetchedVideos=[PHAsset fetchAssetsWithMediaType:PHAssetMediaTypeVideo options:fetchOptions];
NSLog(@"from icloud %lu",_fetchedVideos.count);
if (error) {NSLog(@"error %@", error.localizedDescription);} else {NSLog(@"success");}
}
}];
or by another way :
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
if (status == PHAuthorizationStatusAuthorized) {
PHFetchOptions fetchOptions = [PHFetchOptions new];
fetchOptions.includeAssetSourceTypes=PHAssetSourceTypeCloudShared| PHAssetSourceTypeUserLibrary;
fetchOptions.predicate = [NSPredicate predicateWithFormat:@"mediaType = %d", PHAssetMediaTypeVideo];
NSError error;__block BOOL success = NO;
[photoLibrary performChangesAndWait:^{
success = YES;
NSLog(@"inside");
_fetchedVideos=[PHAsset fetchAssetsWithMediaType:PHAssetMediaTypeVideo options:fetchOptions];
NSLog(@"from icloud %lu",_fetchedVideos.count);
} error:&error];
if (error) {NSLog(@"fail %@", error.localizedDescription);
} else {NSLog(@"success ");}
}
}];
The resto goes well. Every time getting the same warning