mirror of
https://github.com/status-im/react-native-fs.git
synced 2025-02-28 06:50:37 +00:00
The Uploader & Downloader classes cause linker errors with other plugins that also implement classes that are called Uploader or Downloader. E.g. this happens when using react-native-fs in combination with Firebase Crash reporting. Basically both plugins are at fault for not implementing unique class names. This commit adds the RNFS prefix for these classes.
29 lines
1.1 KiB
Objective-C
29 lines
1.1 KiB
Objective-C
#import <Foundation/Foundation.h>
|
|
|
|
typedef void (^DownloadCompleteCallback)(NSNumber*, NSNumber*);
|
|
typedef void (^ErrorCallback)(NSError*);
|
|
typedef void (^BeginCallback)(NSNumber*, NSNumber*, NSDictionary*);
|
|
typedef void (^ProgressCallback)(NSNumber*, NSNumber*);
|
|
|
|
@interface RNFSDownloadParams : NSObject
|
|
|
|
@property (copy) NSString* fromUrl;
|
|
@property (copy) NSString* toFile;
|
|
@property (copy) NSDictionary* headers;
|
|
@property (copy) DownloadCompleteCallback completeCallback; // Download has finished (data written)
|
|
@property (copy) ErrorCallback errorCallback; // Something went wrong
|
|
@property (copy) BeginCallback beginCallback; // Download has started (headers received)
|
|
@property (copy) ProgressCallback progressCallback; // Download is progressing
|
|
@property bool background; // Whether to continue download when app is in background
|
|
@property (copy) NSNumber* progressDivider;
|
|
|
|
|
|
@end
|
|
|
|
@interface RNFSDownloader : NSObject <NSURLSessionDelegate, NSURLSessionDownloadDelegate>
|
|
|
|
- (void)downloadFile:(RNFSDownloadParams*)params;
|
|
- (void)stopDownload;
|
|
|
|
@end
|