BlueWallet/scripts/maccatalystpatches/RCTCameraManagerDiff
2021-07-26 08:35:03 -04:00

41 lines
2.1 KiB
Plaintext

9d8
< #import <AssetsLibrary/ALAssetsLibrary.h>
771,782d769
< else if (target == RCTCameraCaptureTargetCameraRoll) {
< [[[ALAssetsLibrary alloc] init] writeImageDataToSavedPhotosAlbum:imageData metadata:metadata completionBlock:^(NSURL* url, NSError* error) {
< if (error == nil) {
< //path isn't really applicable here (this is an asset uri), but left it in for backward comparability
< resolve(@{@"path":[url absoluteString], @"mediaUri":[url absoluteString]});
< }
< else {
< reject(RCTErrorUnspecified, nil, RCTErrorWithMessage(error.description));
< }
< }];
< return;
< }
921,942c908
< if (self.videoTarget == RCTCameraCaptureTargetCameraRoll) {
< ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
< if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:outputFileURL]) {
< [library writeVideoAtPathToSavedPhotosAlbum:outputFileURL
< completionBlock:^(NSURL *assetURL, NSError *error) {
< if (error) {
< self.videoReject(RCTErrorUnspecified, nil, RCTErrorWithMessage(error.description));
< return;
< } else if (assetURL == nil) {
< //It's possible for writing to camera roll to fail,
< //without receiving an error message, but assetURL will be nil
< //Happens when disk is (almost) full
< self.videoReject(RCTErrorUnspecified, nil, RCTErrorWithMessage(@"Not enough storage"));
< return;
< }
<
< [videoInfo setObject:[assetURL absoluteString] forKey:@"path"];
< self.videoResolve(videoInfo);
< }];
< }
< }
< else if (self.videoTarget == RCTCameraCaptureTargetDisk) {
---
> if (self.videoTarget == RCTCameraCaptureTargetDisk) {