[ios] Fix conditional imports

This commit is contained in:
Chris Bianca 2017-08-11 16:07:32 +01:00
parent 0c69eb5237
commit 97cc5ee131
14 changed files with 52 additions and 29 deletions

View File

@ -1,5 +1,6 @@
#ifndef RNFirebase_h
#define RNFirebase_h
#import <Foundation/Foundation.h>
#import <React/RCTEventEmitter.h>
#import <React/RCTBridgeModule.h>

View File

@ -23,8 +23,7 @@
@end
#else
@interface NativeExpressComponent : NSObject {
}
@interface NativeExpressComponent : NSObject
@end
#endif

View File

@ -1,11 +1,11 @@
#ifndef RNFirebaseAdMob_h
#define RNFirebaseAdMob_h
#import <React/RCTBridgeModule.h>
#import <Foundation/Foundation.h>
#if __has_include(<GoogleMobileAds/GADMobileAds.h>)
#import "Firebase.h"
#import "RNFirebaseEvents.h"
#import <React/RCTBridgeModule.h>
#import "React/RCTEventEmitter.h"
#import "GoogleMobileAds/GADInterstitialDelegate.h"
#import "GoogleMobileAds/GADRewardBasedVideoAdDelegate.h"
@ -23,8 +23,7 @@
@end
#else
@interface RNFirebaseAdMob : NSObject {
}
@interface RNFirebaseAdMob : NSObject
@end
#endif

View File

@ -219,8 +219,7 @@ RCT_EXPORT_METHOD(clearInterstitial:
#else
@interface RNFirebaseAdMobRewardedVideo : NSObject <RCTBridgeModule> {
}
@implementation RNFirebaseAdMob
@end
#endif

View File

@ -1,6 +1,8 @@
#ifndef RNFirebaseAnalytics_h
#define RNFirebaseAnalytics_h
#import <Foundation/Foundation.h>
#if __has_include(<FirebaseAnalytics/FIRAnalytics.h>)
#import <React/RCTBridgeModule.h>
@interface RNFirebaseAnalytics : NSObject <RCTBridgeModule> {
@ -9,4 +11,9 @@
@end
#else
@interface RNFirebaseAnalytics : NSObject
@end
#endif
#endif

View File

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

View File

@ -1,10 +1,17 @@
#ifndef RNFirebaseRemoteConfig_h
#define RNFirebaseRemoteConfig_h
#import <Foundation/Foundation.h>
#if __has_include(<FirebaseRemoteConfig/FirebaseRemoteConfig.h>)
#import <React/RCTBridgeModule.h>
@interface RNFirebaseRemoteConfig : NSObject <RCTBridgeModule>
@end
#else
@interface RNFirebaseRemoteConfig : NSObject
@end
#endif
#endif

View File

@ -1,6 +1,8 @@
#ifndef RNFirebaseCrash_h
#define RNFirebaseCrash_h
#import <Foundation/Foundation.h>
#if __has_include(<FirebaseCrash/FIRCrashLog.h>)
#import <React/RCTBridgeModule.h>
@interface RNFirebaseCrash : NSObject <RCTBridgeModule> {
@ -9,4 +11,9 @@
@end
#else
@interface RNFirebaseCrash : NSObject
@end
#endif
#endif

View File

@ -1,9 +1,9 @@
#ifndef RNFirebaseDatabase_h
#define RNFirebaseDatabase_h
#import <React/RCTBridgeModule.h>
#import <Foundation/Foundation.h>
#if __has_include(<FirebaseDatabase/FIRDatabase.h>)
#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>
@interface RNFirebaseDatabase : RCTEventEmitter<RCTBridgeModule> {}
@ -13,7 +13,7 @@
@end
#else
@interface RNFirebaseDatabase : NSObject<RCTBridgeModule> {}
@interface RNFirebaseDatabase : NSObject
@end
#endif

View File

@ -1,7 +1,9 @@
#ifndef RNFirebaseDatabaseReference_h
#define RNFirebaseDatabaseReference_h
#import <Foundation/Foundation.h>
#if __has_include(<FirebaseDatabase/FIRDatabase.h>)
#import "RNFirebaseEvents.h"
#import <React/RCTEventEmitter.h>
#import "Firebase.h"

View File

@ -1,10 +1,9 @@
#import "RNFirebaseDatabaseReference.h"
#if __has_include(<FirebaseDatabase/FIRDatabase.h>)
#import "RNFirebaseEvents.h"
@implementation RNFirebaseDatabaseReference
#if __has_include(<FirebaseDatabase/FIRDatabase.h>)
- (id)initWithPathAndModifiers:(RCTEventEmitter *)emitter database:(FIRDatabase *)database refId:(NSNumber *)refId path:(NSString *)path modifiers:(NSArray *)modifiers {
self = [super init];
if (self) {
@ -187,9 +186,6 @@
return eventType;
}
@end
#else
@implementation RNFirebaseDatabase
@end
#endif
@end

View File

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

View File

@ -1,6 +1,8 @@
#ifndef RNFirebasePerformance_h
#define RNFirebasePerformance_h
#import <Foundation/Foundation.h>
#if __has_include(<FirebasePerformance/FIRPerformance.h>)
#import <React/RCTBridgeModule.h>
@interface RNFirebasePerformance : NSObject <RCTBridgeModule> {
@ -11,4 +13,9 @@
@end
#else
@interface RNFirebasePerformance : NSObject
@end
#endif
#endif

View File

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