mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-19 05:45:15 +01:00
OPS: RNCamera patch for macOS
This commit is contained in:
parent
c0e748cc9c
commit
8b35b5ba12
40
scripts/maccatalystpatches/RCTCameraManagerDiff
Normal file
40
scripts/maccatalystpatches/RCTCameraManagerDiff
Normal file
@ -0,0 +1,40 @@
|
||||
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) {
|
@ -5,6 +5,8 @@ echo "Re-installing node_modules"
|
||||
npm i
|
||||
echo "Applying patch for react-native-xcode.sh"
|
||||
sed -i '' 's/--platform "$BUNDLE_PLATFORM"/--platform "ios"/g' ./node_modules/react-native/scripts/react-native-xcode.sh
|
||||
echo "Applying patch for RCTCameraManager.m"
|
||||
patch node_modules/react-native-camera/ios/RCT/RCTCameraManager.m scripts/maccatalystpatches/RCTCameraManagerDiff
|
||||
echo "Deleting torrific.js content"
|
||||
echo > blue_modules/torrific.js
|
||||
echo ""
|
||||
|
Loading…
Reference in New Issue
Block a user