Skip to content

Commit

Permalink
Add support for ph:// uris to copyAssetsVideoIOS
Browse files Browse the repository at this point in the history
resolves #805
  • Loading branch information
enumura committed Feb 9, 2020
1 parent 4067f36 commit 54abed5
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 54abed5

Please sign in to comment.