Skip to content

Commit

Permalink
Merge branch 'leonid-shevtsov-macos-catalyst-fixes'
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
itinance committed Oct 19, 2019
2 parents ea3abba + 6a51902 commit a77e79a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>`

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.
Expand All @@ -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<string>

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<void>`
Expand Down
6 changes: 6 additions & 0 deletions RNFSManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,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.
Expand Down Expand Up @@ -815,7 +817,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.
*
Expand Down Expand Up @@ -869,6 +874,7 @@ + (BOOL)requiresMainQueueSetup

return resolve(destination);
}
#endif

RCT_EXPORT_METHOD(touch:(NSString*)filepath
mtime:(NSDate *)mtime
Expand Down

0 comments on commit a77e79a

Please sign in to comment.