Skip to content

Commit

Permalink
[ios] Fix conditional imports
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbianca committed Aug 11, 2017
1 parent 0c69eb5 commit 97cc5ee
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 28 deletions.
1 change: 1 addition & 0 deletions ios/RNFirebase/RNFirebase.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef RNFirebase_h
#define RNFirebase_h
#import <Foundation/Foundation.h>

#import <React/RCTEventEmitter.h>
#import <React/RCTBridgeModule.h>
Expand Down
3 changes: 1 addition & 2 deletions ios/RNFirebase/admob/NativeExpressComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
@end
#else

@interface NativeExpressComponent : NSObject {
}
@interface NativeExpressComponent : NSObject
@end

#endif
7 changes: 3 additions & 4 deletions ios/RNFirebase/admob/RNFirebaseAdMob.h
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -23,8 +23,7 @@
@end

#else
@interface RNFirebaseAdMob : NSObject {
}
@interface RNFirebaseAdMob : NSObject
@end
#endif

Expand Down
3 changes: 1 addition & 2 deletions ios/RNFirebase/admob/RNFirebaseAdMob.m
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ + (GADAdSize)stringToAdSize:(NSString *)value {

#else

@interface RNFirebaseAdMobRewardedVideo : NSObject <RCTBridgeModule> {
}
@implementation RNFirebaseAdMob
@end

#endif
7 changes: 7 additions & 0 deletions ios/RNFirebase/analytics/RNFirebaseAnalytics.h
Original file line number Diff line number Diff line change
@@ -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> {
Expand All @@ -9,4 +11,9 @@

@end

#else
@interface RNFirebaseAnalytics : NSObject
@end
#endif

#endif
7 changes: 3 additions & 4 deletions ios/RNFirebase/auth/RNFirebaseAuth.h
Original file line number Diff line number Diff line change
@@ -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> {
Expand All @@ -15,8 +15,7 @@
@end

#else
@interface RNFirebaseAuth : NSObject <RCTBridgeModule> {
}
@interface RNFirebaseAuth : NSObject
@end
#endif

Expand Down
7 changes: 7 additions & 0 deletions ios/RNFirebase/config/RNFirebaseRemoteConfig.h
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions ios/RNFirebase/crash/RNFirebaseCrash.h
Original file line number Diff line number Diff line change
@@ -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> {
Expand All @@ -9,4 +11,9 @@

@end

#else
@interface RNFirebaseCrash : NSObject
@end
#endif

#endif
6 changes: 3 additions & 3 deletions ios/RNFirebase/database/RNFirebaseDatabase.h
Original file line number Diff line number Diff line change
@@ -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> {}
Expand All @@ -13,7 +13,7 @@
@end

#else
@interface RNFirebaseDatabase : NSObject<RCTBridgeModule> {}
@interface RNFirebaseDatabase : NSObject
@end
#endif

Expand Down
2 changes: 2 additions & 0 deletions ios/RNFirebase/database/RNFirebaseDatabaseReference.h
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
10 changes: 3 additions & 7 deletions ios/RNFirebase/database/RNFirebaseDatabaseReference.m
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down Expand Up @@ -187,9 +186,6 @@ - (int)eventTypeFromName:(NSString *)name {
return eventType;
}

@end
#endif

#else
@implementation RNFirebaseDatabase
@end
#endif
6 changes: 3 additions & 3 deletions ios/RNFirebase/messaging/RNFirebaseMessaging.h
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -28,7 +28,7 @@ typedef void (^RCTNotificationResponseCallback)();
@end

#else
@interface RNFirebaseMessaging : NSObject<RCTBridgeModule>
@interface RNFirebaseMessaging : NSObject
@end
#endif

Expand Down
7 changes: 7 additions & 0 deletions ios/RNFirebase/perf/RNFirebasePerformance.h
Original file line number Diff line number Diff line change
@@ -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> {
Expand All @@ -11,4 +13,9 @@

@end

#else
@interface RNFirebasePerformance : NSObject
@end
#endif

#endif
6 changes: 3 additions & 3 deletions ios/RNFirebase/storage/RNFirebaseStorage.h
Original file line number Diff line number Diff line change
@@ -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> {
Expand All @@ -13,7 +13,7 @@
@end

#else
@interface RNFirebaseStorage : NSObject<RCTBridgeModule>
@interface RNFirebaseStorage : NSObject
@end
#endif

Expand Down

0 comments on commit 97cc5ee

Please sign in to comment.