2017-03-09 15:26:28 +00:00
|
|
|
#ifndef RNFirebaseDatabase_h
|
|
|
|
#define RNFirebaseDatabase_h
|
2017-08-12 18:07:51 +00:00
|
|
|
|
2017-08-11 15:07:32 +00:00
|
|
|
#import <Foundation/Foundation.h>
|
2017-03-09 15:26:28 +00:00
|
|
|
|
2017-05-25 15:00:12 +00:00
|
|
|
#if __has_include(<FirebaseDatabase/FIRDatabase.h>)
|
2017-08-12 18:07:51 +00:00
|
|
|
|
|
|
|
#import <FirebaseDatabase/FIRDatabase.h>
|
2017-08-11 15:07:32 +00:00
|
|
|
#import <React/RCTBridgeModule.h>
|
2017-05-31 14:53:08 +00:00
|
|
|
#import <React/RCTEventEmitter.h>
|
2017-03-09 15:26:28 +00:00
|
|
|
|
2017-08-12 18:07:51 +00:00
|
|
|
@interface RNFirebaseDatabase : RCTEventEmitter <RCTBridgeModule> {}
|
2017-03-09 15:26:28 +00:00
|
|
|
@property NSMutableDictionary *dbReferences;
|
2017-03-25 00:59:27 +00:00
|
|
|
@property NSMutableDictionary *transactions;
|
|
|
|
@property dispatch_queue_t transactionQueue;
|
2017-08-02 15:51:00 +00:00
|
|
|
|
2017-08-12 18:07:51 +00:00
|
|
|
+ (void)handlePromise:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject databaseError:(NSError *)databaseError;
|
|
|
|
|
2018-01-03 20:00:38 +00:00
|
|
|
+ (FIRDatabase *)getDatabaseForApp:(NSString *)appDisplayName;
|
2017-08-12 18:07:51 +00:00
|
|
|
|
2017-08-22 16:29:02 +00:00
|
|
|
+ (NSDictionary *)getJSError:(NSError *)nativeError;
|
|
|
|
|
2017-08-12 18:07:51 +00:00
|
|
|
+ (NSString *)getMessageWithService:(NSString *)message service:(NSString *)service fullCode:(NSString *)fullCode;
|
|
|
|
|
|
|
|
+ (NSString *)getCodeWithService:(NSString *)service code:(NSString *)code;
|
2017-08-02 15:51:00 +00:00
|
|
|
|
2017-05-25 15:00:12 +00:00
|
|
|
@end
|
2017-03-09 15:26:28 +00:00
|
|
|
|
2017-05-25 15:00:12 +00:00
|
|
|
#else
|
2017-08-11 15:07:32 +00:00
|
|
|
@interface RNFirebaseDatabase : NSObject
|
2017-03-09 15:26:28 +00:00
|
|
|
@end
|
2017-05-25 15:00:12 +00:00
|
|
|
#endif
|
2017-03-09 15:26:28 +00:00
|
|
|
|
|
|
|
#endif
|