Skip to content

Commit 8f850ef

Browse files
committed
Fix includes for react, Update documentation
1 parent a9a2b61 commit 8f850ef

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

docs/index.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,11 @@ crash handler in your `AppDelegate.m` after the root view was created:
169169

170170
.. sourcecode:: objc
171171

172-
#import <React/RNSentry.h>
172+
#if __has_include(<React/RNSentry.h>)
173+
#import <React/RNSentry.h> // This is used for versions of react >= 0.40
174+
#else
175+
#import "RNSentry.h" // This is used for versions of react < 0.40
176+
#endif
173177

174178
/* ... */
175179
[RNSentry installWithRootView:rootView];

examples/ReactNativeExample/ios/ReactNativeExample/AppDelegate.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
#import <React/RCTBundleURLProvider.h>
1313
#import <React/RCTRootView.h>
1414
#import <React/RNSentry.h>
15+
#if __has_include(<React/RNSentry.h>)
16+
#import <React/RNSentry.h> // This is used for versions of react >= 0.40
17+
#else
18+
#import "RNSentry.h" // This is used for versions of react < 0.40
19+
#endif
20+
1521

1622
@interface AppDelegate()
1723

ios/RNSentry.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#import "RNSentry.h"
22
#import "RSSwizzle.h"
3+
#if __has_include(<React/RCTConvert.h>)
34
#import <React/RCTConvert.h>
5+
#else
6+
#import "RCTConvert.h"
7+
#endif
8+
49

510
@import Sentry;
611

0 commit comments

Comments
 (0)