Skip to content

Commit d941c21

Browse files
committed
Add support for ph:// uris to copyAssetsVideoIOS
Same way as itinance#736 resolves itinance#805
1 parent 4067f36 commit d941c21

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

RNFSManager.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,13 @@ + (BOOL)requiresMainQueueSetup
860860
//__block NSURL* videoURL = [NSURL URLWithString:destination];
861861
__block NSError *error = nil;
862862

863-
PHFetchResult *phAssetFetchResult = [PHAsset fetchAssetsWithALAssetURLs:@[url] options:nil];
863+
PHFetchResult *phAssetFetchResult = nil;
864+
if ([url.scheme isEqualToString:@"ph"]) {
865+
phAssetFetchResult = [PHAsset fetchAssetsWithLocalIdentifiers:@[[imageUri substringFromIndex: 5]] options:nil];
866+
} else {
867+
phAssetFetchResult = [PHAsset fetchAssetsWithALAssetURLs:@[url] options:nil];
868+
}
869+
864870
PHAsset *phAsset = [phAssetFetchResult firstObject];
865871

866872
PHVideoRequestOptions *options = [[PHVideoRequestOptions alloc] init];

0 commit comments

Comments
 (0)