[ios] Remove eventemitter interface when module hasn’t been included

This commit is contained in:
Chris Bianca 2017-05-31 15:53:08 +01:00
parent a162a0d6f5
commit 51f50ca17d
4 changed files with 16 additions and 9 deletions

View File

@ -1,11 +1,11 @@
#ifndef RNFirebaseAuth_h #ifndef RNFirebaseAuth_h
#define RNFirebaseAuth_h #define RNFirebaseAuth_h
#import <React/RCTEventEmitter.h>
#import <React/RCTBridgeModule.h> #import <React/RCTBridgeModule.h>
#if __has_include(<FirebaseAuth/FIRAuth.h>) #if __has_include(<FirebaseAuth/FIRAuth.h>)
#import "Firebase.h" #import "Firebase.h"
#import <React/RCTEventEmitter.h>
@interface RNFirebaseAuth : RCTEventEmitter <RCTBridgeModule> { @interface RNFirebaseAuth : RCTEventEmitter <RCTBridgeModule> {
FIRAuthStateDidChangeListenerHandle authListenerHandle; FIRAuthStateDidChangeListenerHandle authListenerHandle;
@ -15,7 +15,7 @@
@end @end
#else #else
@interface RNFirebaseAuth : RCTEventEmitter <RCTBridgeModule> { @interface RNFirebaseAuth : NSObject <RCTBridgeModule> {
} }
@end @end
#endif #endif

View File

@ -1,19 +1,19 @@
#ifndef RNFirebaseDatabase_h #ifndef RNFirebaseDatabase_h
#define RNFirebaseDatabase_h #define RNFirebaseDatabase_h
#import <React/RCTEventEmitter.h>
#import <React/RCTBridgeModule.h> #import <React/RCTBridgeModule.h>
#if __has_include(<FirebaseDatabase/FIRDatabase.h>) #if __has_include(<FirebaseDatabase/FIRDatabase.h>)
#import <React/RCTEventEmitter.h>
@interface RNFirebaseDatabase : RCTEventEmitter <RCTBridgeModule> {} @interface RNFirebaseDatabase : RCTEventEmitter<RCTBridgeModule> {}
@property NSMutableDictionary *dbReferences; @property NSMutableDictionary *dbReferences;
@property NSMutableDictionary *transactions; @property NSMutableDictionary *transactions;
@property dispatch_queue_t transactionQueue; @property dispatch_queue_t transactionQueue;
@end @end
#else #else
@interface RNFirebaseDatabase : RCTEventEmitter <RCTBridgeModule> {} @interface RNFirebaseDatabase : NSObject<RCTBridgeModule> {}
@end @end
#endif #endif

View File

@ -1,11 +1,11 @@
#ifndef RNFirebaseMessaging_h #ifndef RNFirebaseMessaging_h
#define RNFirebaseMessaging_h #define RNFirebaseMessaging_h
#import <React/RCTEventEmitter.h>
#import <React/RCTBridgeModule.h> #import <React/RCTBridgeModule.h>
#if __has_include(<FirebaseMessaging/FirebaseMessaging.h>) #if __has_include(<FirebaseMessaging/FirebaseMessaging.h>)
#import <FirebaseMessaging/FirebaseMessaging.h> #import <FirebaseMessaging/FirebaseMessaging.h>
#import <React/RCTEventEmitter.h>
@import UserNotifications; @import UserNotifications;
@ -26,7 +26,7 @@ typedef void (^RCTNotificationResponseCallback)();
@end @end
#else #else
@interface RNFirebaseMessaging : RCTEventEmitter<RCTBridgeModule> @interface RNFirebaseMessaging : NSObject<RCTBridgeModule>
@end @end
#endif #endif

View File

@ -1,13 +1,20 @@
#ifndef RNFirebaseStorage_h #ifndef RNFirebaseStorage_h
#define RNFirebaseStorage_h #define RNFirebaseStorage_h
#import <React/RCTEventEmitter.h>
#import <React/RCTBridgeModule.h> #import <React/RCTBridgeModule.h>
@interface RNFirebaseStorage : RCTEventEmitter <RCTBridgeModule> { #if __has_include(<FirebaseStorage/FIRStorage.h>)
#import <React/RCTEventEmitter.h>
@interface RNFirebaseStorage : RCTEventEmitter<RCTBridgeModule> {
} }
@end @end
#else
@interface RNFirebaseStorage : NSObject<RCTBridgeModule>
@end
#endif
#endif #endif