Skip to content

Commit adb0977

Browse files
author
Mathias Kahl
committed
macOS support
1 parent f2f8f4a commit adb0977

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ For RN >= 0.61 please install react-native-fs at version >= @2.16.0!
2525

2626
View the changelog [here](https://github.com/itinance/react-native-fs/blob/master/CHANGELOG.md).
2727

28-
## Usage (iOS)
28+
## Usage (iOS/macOS)
2929

3030
First you need to install react-native-fs:
3131

RNFS.podspec

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Pod::Spec.new do |s|
1212

1313
s.ios.deployment_target = '8.0'
1414
s.tvos.deployment_target = '9.2'
15+
s.osx.deployment_target = '10.10'
1516

1617
s.source = { :git => "https://github.com/itinance/react-native-fs", :tag => "v#{s.version}" }
1718
s.source_files = '*.{h,m}'

RNFSManager.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ + (BOOL)requiresMainQueueSetup
747747

748748

749749
// [PHAsset fetchAssetsWithALAssetURLs] is deprecated and not supported in Mac Catalyst
750-
#if !TARGET_OS_UIKITFORMAC
750+
#if !TARGET_OS_UIKITFORMAC && !TARGET_OS_OSX
751751
/**
752752
* iOS Only: copy images from the assets-library (camera-roll) to a specific path, asuming
753753
* JPEG-Images.
@@ -844,7 +844,7 @@ + (BOOL)requiresMainQueueSetup
844844
#endif
845845

846846
// [PHAsset fetchAssetsWithALAssetURLs] is deprecated and not supported in Mac Catalyst
847-
#if !TARGET_OS_UIKITFORMAC
847+
#if !TARGET_OS_UIKITFORMAC && !TARGET_OS_OSX
848848
/**
849849
* iOS Only: copy videos from the assets-library (camera-roll) to a specific path as mp4-file.
850850
*

Uploader.h

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#import <Foundation/Foundation.h>
2+
3+
#if !TARGET_OS_OSX
24
#import <MobileCoreServices/MobileCoreServices.h>
5+
#endif
36

47
typedef void (^UploadCompleteCallback)(NSString*, NSURLResponse *);
58
typedef void (^UploadErrorCallback)(NSError*);

0 commit comments

Comments
 (0)