From e70cff54296255b9ca170598df975986d1f56c66 Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 8 Feb 2020 10:17:48 +0800 Subject: [PATCH] fix: fix IOS MetaData (#134) * changes to fix IOS MetaData * chore: fix formatting Co-authored-by: Bartol Karuza --- ios/RNCCameraRollManager.m | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/ios/RNCCameraRollManager.m b/ios/RNCCameraRollManager.m index 7a879cdb5..c475e9767 100644 --- a/ios/RNCCameraRollManager.m +++ b/ios/RNCCameraRollManager.m @@ -140,7 +140,7 @@ RCT_EXPORT_METHOD(saveToCameraRoll:(NSURLRequest *)request if ([options[@"type"] isEqualToString:@"video"]) { assetRequest = [PHAssetChangeRequest creationRequestForAssetFromVideoAtFileURL:inputURI]; } else { - assetRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:inputImage]; + assetRequest = [PHAssetChangeRequest creationRequestForAssetFromImageAtFileURL:inputURI]; } placeholder = [assetRequest placeholderForCreatedAsset]; if (![options[@"album"] isEqualToString:@""]) { @@ -189,20 +189,8 @@ RCT_EXPORT_METHOD(saveToCameraRoll:(NSURLRequest *)request }; void (^loadBlock)(void) = ^void() { - if ([options[@"type"] isEqualToString:@"video"]) { - inputURI = request.URL; - saveWithOptions(); - } else { - [[self.bridge moduleForName:@"ImageLoader" lazilyLoadIfNecessary:YES] loadImageWithURLRequest:request callback:^(NSError *error, UIImage *image) { - if (error) { - reject(kErrorUnableToLoad, nil, error); - return; - } - - inputImage = image; - saveWithOptions(); - }]; - } + inputURI = request.URL; + saveWithOptions(); }; requestPhotoLibraryAccess(reject, loadBlock);