Skip to content

Commit a77e79a

Browse files
committed
Merge branch 'leonid-shevtsov-macos-catalyst-fixes'
* leonid-shevtsov-macos-catalyst-fixes: Added a note that copyAssetsFileIOS and copyAssetsVideoIOS aren't supported on Mac Catalist Add conditional comments around methods not supported in Mac Catalyst
2 parents ea3abba + 6a51902 commit a77e79a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ Note: Android only. Will overwrite destPath if it already exists.
442442

443443
### `copyAssetsFileIOS(imageUri: string, destPath: string, width: number, height: number, scale : number = 1.0, compression : number = 1.0, resizeMode : string = 'contain' ): Promise<string>`
444444

445-
iOS-only: copies a file from camera-roll, that is prefixed with "assets-library://asset/asset.JPG?..."
445+
iOS-only (not available on Mac Catalyst): copies a file from camera-roll, that is prefixed with "assets-library://asset/asset.JPG?..."
446446
to a specific destination. It will download the original from iCloud if necessary.
447447

448448
If width and height is > 0, the image will be resized to a specific size and a specific compression rate.
@@ -461,7 +461,7 @@ The promise will on success return the final destination of the file, as it was
461461

462462
### copyAssetsVideoIOS(videoUri: string, destPath: string): Promise<string>
463463

464-
iOS-only: copies a video from assets-library, that is prefixed with 'assets-library://asset/asset.MOV?...'
464+
iOS-only (not available on Mac Catalyst): copies a video from assets-library, that is prefixed with 'assets-library://asset/asset.MOV?...'
465465
to a specific destination.
466466

467467
### `unlink(filepath: string): Promise<void>`

RNFSManager.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ + (BOOL)requiresMainQueueSetup
727727
}
728728

729729

730+
// [PHAsset fetchAssetsWithALAssetURLs] is deprecated and not supported in Mac Catalyst
731+
#if !TARGET_OS_UIKITFORMAC
730732
/**
731733
* iOS Only: copy images from the assets-library (camera-roll) to a specific path, asuming
732734
* JPEG-Images.
@@ -815,7 +817,10 @@ + (BOOL)requiresMainQueueSetup
815817
}
816818
}];
817819
}
820+
#endif
818821

822+
// [PHAsset fetchAssetsWithALAssetURLs] is deprecated and not supported in Mac Catalyst
823+
#if !TARGET_OS_UIKITFORMAC
819824
/**
820825
* iOS Only: copy videos from the assets-library (camera-roll) to a specific path as mp4-file.
821826
*
@@ -869,6 +874,7 @@ + (BOOL)requiresMainQueueSetup
869874

870875
return resolve(destination);
871876
}
877+
#endif
872878

873879
RCT_EXPORT_METHOD(touch:(NSString*)filepath
874880
mtime:(NSDate *)mtime

0 commit comments

Comments
 (0)