From 82980c30a2d07083d0b74e7496d445856a01f02d Mon Sep 17 00:00:00 2001 From: Leonid Shevtsov Date: Thu, 10 Oct 2019 08:36:32 +0300 Subject: [PATCH 1/2] Add conditional comments around methods not supported in Mac Catalyst --- RNFSManager.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RNFSManager.m b/RNFSManager.m index 68c178fd..f526b45d 100755 --- a/RNFSManager.m +++ b/RNFSManager.m @@ -708,6 +708,8 @@ + (BOOL)requiresMainQueueSetup } +// [PHAsset fetchAssetsWithALAssetURLs] is deprecated and not supported in Mac Catalyst +#if !TARGET_OS_UIKITFORMAC /** * iOS Only: copy images from the assets-library (camera-roll) to a specific path, asuming * JPEG-Images. @@ -796,7 +798,10 @@ + (BOOL)requiresMainQueueSetup } }]; } +#endif +// [PHAsset fetchAssetsWithALAssetURLs] is deprecated and not supported in Mac Catalyst +#if !TARGET_OS_UIKITFORMAC /** * iOS Only: copy videos from the assets-library (camera-roll) to a specific path as mp4-file. * @@ -849,6 +854,7 @@ + (BOOL)requiresMainQueueSetup return resolve(destination); } +#endif RCT_EXPORT_METHOD(touch:(NSString*)filepath mtime:(NSDate *)mtime From 6a51902e8b7273554c72410dcde23e81ed51f311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hagen=20H=C3=BCbel?= Date: Sat, 19 Oct 2019 11:49:09 +0200 Subject: [PATCH 2/2] Added a note that copyAssetsFileIOS and copyAssetsVideoIOS aren't supported on Mac Catalist --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 63150fd1..15fa2eb4 100644 --- a/README.md +++ b/README.md @@ -442,7 +442,7 @@ Note: Android only. Will overwrite destPath if it already exists. ### `copyAssetsFileIOS(imageUri: string, destPath: string, width: number, height: number, scale : number = 1.0, compression : number = 1.0, resizeMode : string = 'contain' ): Promise` -iOS-only: copies a file from camera-roll, that is prefixed with "assets-library://asset/asset.JPG?..." +iOS-only (not available on Mac Catalyst): copies a file from camera-roll, that is prefixed with "assets-library://asset/asset.JPG?..." to a specific destination. It will download the original from iCloud if necessary. 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 ### copyAssetsVideoIOS(videoUri: string, destPath: string): Promise -iOS-only: copies a video from assets-library, that is prefixed with 'assets-library://asset/asset.MOV?...' +iOS-only (not available on Mac Catalyst): copies a video from assets-library, that is prefixed with 'assets-library://asset/asset.MOV?...' to a specific destination. ### `unlink(filepath: string): Promise`