react-native-fs/Uploader.h
IjzerenHein b26fb5fd8f Fixed symbol collision errors with other plugins by adding RNFS prefix to Download & Upload classes
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.
2016-07-21 09:59:37 +02:00

29 lines
1014 B
Objective-C

#import <Foundation/Foundation.h>
#import <MobileCoreServices/MobileCoreServices.h>
typedef void (^UploadCompleteCallback)(NSString*, NSURLResponse *);
typedef void (^UploadErrorCallback)(NSError*);
typedef void (^UploadBeginCallback)();
typedef void (^UploadProgressCallback)(NSNumber*, NSNumber*);
@interface RNFSUploadParams : NSObject
@property (copy) NSString* toUrl;
@property (copy) NSArray* files;
@property (copy) NSDictionary* headers;
@property (copy) NSDictionary* fields;
@property (copy) NSString* method;
@property (copy) UploadCompleteCallback completeCallback; // Upload has finished (data written)
@property (copy) UploadErrorCallback errorCallback; // Something gone wrong
@property (copy) UploadBeginCallback beginCallback; // Upload has started
@property (copy) UploadProgressCallback progressCallback; // Upload is progressing
@end
@interface RNFSUploader : NSObject <NSURLConnectionDelegate>
- (void)uploadFiles:(RNFSUploadParams*)params;
- (void)stopUpload;
@end