From 8f850efd85ae5ada8801d428c967240f66843d4f Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Mon, 27 Mar 2017 09:30:46 +0200 Subject: [PATCH] Fix includes for react, Update documentation --- docs/index.rst | 6 +++++- .../ReactNativeExample/ios/ReactNativeExample/AppDelegate.m | 6 ++++++ ios/RNSentry.m | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 4d2a824824..cfb097c2c8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -169,7 +169,11 @@ crash handler in your `AppDelegate.m` after the root view was created: .. sourcecode:: objc - #import + #if __has_include() + #import // This is used for versions of react >= 0.40 + #else + #import "RNSentry.h" // This is used for versions of react < 0.40 + #endif /* ... */ [RNSentry installWithRootView:rootView]; diff --git a/examples/ReactNativeExample/ios/ReactNativeExample/AppDelegate.m b/examples/ReactNativeExample/ios/ReactNativeExample/AppDelegate.m index 2a74b08a4e..1bb960abfb 100644 --- a/examples/ReactNativeExample/ios/ReactNativeExample/AppDelegate.m +++ b/examples/ReactNativeExample/ios/ReactNativeExample/AppDelegate.m @@ -12,6 +12,12 @@ #import #import #import +#if __has_include() +#import // This is used for versions of react >= 0.40 +#else +#import "RNSentry.h" // This is used for versions of react < 0.40 +#endif + @interface AppDelegate() diff --git a/ios/RNSentry.m b/ios/RNSentry.m index 9e022ce81a..5333e7cb8f 100644 --- a/ios/RNSentry.m +++ b/ios/RNSentry.m @@ -1,6 +1,11 @@ #import "RNSentry.h" #import "RSSwizzle.h" +#if __has_include() #import +#else +#import "RCTConvert.h" +#endif + @import Sentry;