fix: Error Domain=PHPhotosErrorDomain Code=-1 (#172)

fixes #157 
fixes #143 

* Update RNCCameraRollManager.m
This commit is contained in:
Conner Owen 2020-05-08 13:41:46 -06:00 committed by GitHub
parent 7c2986ef13
commit a4be52cf83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -138,7 +138,9 @@ RCT_EXPORT_METHOD(saveToCameraRoll:(NSURLRequest *)request
if ([options[@"type"] isEqualToString:@"video"]) { if ([options[@"type"] isEqualToString:@"video"]) {
assetRequest = [PHAssetChangeRequest creationRequestForAssetFromVideoAtFileURL:inputURI]; assetRequest = [PHAssetChangeRequest creationRequestForAssetFromVideoAtFileURL:inputURI];
} else { } else {
assetRequest = [PHAssetChangeRequest creationRequestForAssetFromImageAtFileURL:inputURI]; NSData *data = [NSData dataWithContentsOfURL:inputURI];
UIImage *image = [UIImage imageWithData:data];
assetRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:image];
} }
placeholder = [assetRequest placeholderForCreatedAsset]; placeholder = [assetRequest placeholderForCreatedAsset];
if (![options[@"album"] isEqualToString:@""]) { if (![options[@"album"] isEqualToString:@""]) {