Skip to content

Commit

Permalink
Add support for ph:// uris to copyAssetsVideoIOS
Browse files Browse the repository at this point in the history
Same way as itinance#736
resolves itinance#805
  • Loading branch information
daremura committed Feb 8, 2020
1 parent 4067f36 commit d941c21
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion RNFSManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,13 @@ + (BOOL)requiresMainQueueSetup
//__block NSURL* videoURL = [NSURL URLWithString:destination];
__block NSError *error = nil;

PHFetchResult *phAssetFetchResult = [PHAsset fetchAssetsWithALAssetURLs:@[url] options:nil];
PHFetchResult *phAssetFetchResult = nil;
if ([url.scheme isEqualToString:@"ph"]) {
phAssetFetchResult = [PHAsset fetchAssetsWithLocalIdentifiers:@[[imageUri substringFromIndex: 5]] options:nil];
} else {
phAssetFetchResult = [PHAsset fetchAssetsWithALAssetURLs:@[url] options:nil];
}

PHAsset *phAsset = [phAssetFetchResult firstObject];

PHVideoRequestOptions *options = [[PHVideoRequestOptions alloc] init];
Expand Down

0 comments on commit d941c21

Please sign in to comment.