Skip to content

Commit 16c895a

Browse files
committed
fix(native): ensure we don't require flipper on iOS if not installed
1 parent aaa7a0f commit 16c895a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
#import <Foundation/Foundation.h>
22

3+
#if __has_include(<FlipperKit/FlipperPlugin.h>)
34
#import <FlipperKit/FlipperPlugin.h>
45
#import <React/RCTBridge.h>
56

67
@interface FlipperPerformancePlugin : NSObject<RCTBridgeModule, FlipperPlugin>
78

89
@end
10+
11+
#else
12+
@interface FlipperPerformancePlugin : NSObject
13+
14+
@end
15+
#endif

flipper-native/ios/FlipperPerformancePlugin.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#import "FlipperPerformancePlugin.h"
2+
3+
#if __has_include(<FlipperKit/FlipperPlugin.h>)
24
#import <FlipperKit/FlipperConnection.h>
35
// This ensures we can use [_bridge dispatchBlock]
46
#import <React/RCTBridge+Private.h>
@@ -170,3 +172,11 @@ - (int)fibonacci:(int)n {
170172
}
171173

172174
@end
175+
176+
#else
177+
178+
@implementation FlipperPerformancePlugin
179+
180+
@end
181+
182+
#endif

0 commit comments

Comments
 (0)