From 04432d03a53291c4f05679f38a40b013c4b776ad Mon Sep 17 00:00:00 2001 From: Neil Manvar Date: Mon, 15 Jul 2019 10:41:44 -0700 Subject: [PATCH 1/5] add all linked files back in and trim down README.md --- README.md | 48 +++----- ReactNativeDemo/App.js | 7 +- ReactNativeDemo/android/app/build.gradle | 2 + .../com/reactnativedemo/MainApplication.java | 4 +- ReactNativeDemo/android/sentry.properties | 4 + ReactNativeDemo/android/settings.gradle | 2 + .../ReactNativeDemo.xcodeproj/project.pbxproj | 104 +++++++++++++++++- .../ios/ReactNativeDemo/AppDelegate.m | 8 +- ReactNativeDemo/ios/sentry.properties | 3 +- 9 files changed, 140 insertions(+), 42 deletions(-) create mode 100644 ReactNativeDemo/android/sentry.properties diff --git a/README.md b/README.md index 74f229bd..299903e3 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,34 @@ # sentry-demos/react-native - https://docs.sentry.io/clients/react-native/ ## Goal/Summary: Show how Sentry works to surface errors in react-native applications (stacktraces will be symbolicated + unminified) -## First-time Setup -this project uses: -React Native v0.59.10 -react-native-sentry ^0.43.2 -react-native-cli: 2.0.1 +## Setup +1. Create a React Native project on Sentry.io +2. Install all dependencies (node, watchmen, JDK) listed under https://facebook.github.io/react-native/docs/getting-started.html#node-watchman-jdk +3. Install cocoapods (`gem install cocoapods`) +3. Install react-native-cli: `npm install -g react-native-cli@2.0.1` +4. `cd ReactNativeDemo` +5. Use nvm version specified in .nvmrc: `nvm use` +6. Install packages: `npm install` +7. Replace DSN in App.js with project's DSN +8. Replace org and project in ios/sentry.properties + android/sentry.properties -0. create a React Native project on Sentry.io (the `link` command below will have you select your RN project) -1. cd ReactNativeDemo -2. Install dependencies -``` -npm install -g react-native-cli -npm install && yarn install -``` -3. Remove Sentry import and install code (lines 4-8) in App.js -4. `sentry`react-native link react-native-sentry` -updates the following: -modified: android/app/build.gradle - modified: android/app/src/main/java/com/reactnativedemo/MainApplication.java - modified: android/settings.gradle - modified: ios/ReactNativeDemo.xcodeproj/project.pbxproj - modified: ios/ReactNativeDemo/AppDelegate.m - modified: ios/sentry.properties - modified: package-lock.json - modified: yarn.lock - modified: App.js -5. Run it -ios +# Run +### iOS: ``` $ react-native run-ios --configuration Release ``` -android +### Android ``` -$ react-native run-android --variant +$ react-native run-android --variant Release ``` +-> Simulator/Emulator should have launched with sample app. Trigger errors and go to Sentry to see them! -6. Simulator/Emulator should have launched with sample app. Trigger errors and go to Sentry to see them! +# Change project +1. Replace DSN in App.js +2. Replace org and project in ios/sentry.properties + android/sentry.properties. # GIF (JS error) ![Alt Text](react-native-demo.gif) diff --git a/ReactNativeDemo/App.js b/ReactNativeDemo/App.js index c39d5578..e9b91dc6 100644 --- a/ReactNativeDemo/App.js +++ b/ReactNativeDemo/App.js @@ -1,14 +1,13 @@ import React, {Component} from 'react'; import {Button, Platform, StyleSheet, Text, View, TextInput, ImageBackground, Image} from 'react-native'; -import { Sentry, SentrySeverity, SentryLog } from 'react-native-sentry'; -Sentry.config('', { +import {Sentry, SentrySeverity, SentryLog} from 'react-native-sentry'; + +Sentry.config('https://4f4c77ac999c47248f4b202aaa39c9f0@sentry.io/1481922', { logLevel: SentryLog.Debug, deactivateStacktraceMerging: false }).install(); - - type Props = {}; export default class App extends Component { render() { diff --git a/ReactNativeDemo/android/app/build.gradle b/ReactNativeDemo/android/app/build.gradle index 183b448f..998671bc 100644 --- a/ReactNativeDemo/android/app/build.gradle +++ b/ReactNativeDemo/android/app/build.gradle @@ -77,6 +77,7 @@ project.ext.react = [ ] apply from: "../../node_modules/react-native/react.gradle" +apply from: "../../node_modules/react-native-sentry/sentry.gradle" /** * Set this to true to create two separate APKs instead of one: @@ -138,6 +139,7 @@ android { } dependencies { + implementation project(':react-native-sentry') implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" implementation "com.facebook.react:react-native:+" // From node_modules diff --git a/ReactNativeDemo/android/app/src/main/java/com/reactnativedemo/MainApplication.java b/ReactNativeDemo/android/app/src/main/java/com/reactnativedemo/MainApplication.java index 1a801741..3e688789 100644 --- a/ReactNativeDemo/android/app/src/main/java/com/reactnativedemo/MainApplication.java +++ b/ReactNativeDemo/android/app/src/main/java/com/reactnativedemo/MainApplication.java @@ -3,6 +3,7 @@ import android.app.Application; import com.facebook.react.ReactApplication; +import io.sentry.RNSentryPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; @@ -22,7 +23,8 @@ public boolean getUseDeveloperSupport() { @Override protected List getPackages() { return Arrays.asList( - new MainReactPackage() + new MainReactPackage(), + new RNSentryPackage() ); } diff --git a/ReactNativeDemo/android/sentry.properties b/ReactNativeDemo/android/sentry.properties new file mode 100644 index 00000000..495ad93d --- /dev/null +++ b/ReactNativeDemo/android/sentry.properties @@ -0,0 +1,4 @@ +defaults.url=https://sentry.io/ +defaults.org=testorg-az +defaults.project=react-native-mobile +cli.executable=node_modules/@sentry/cli/bin/sentry-cli diff --git a/ReactNativeDemo/android/settings.gradle b/ReactNativeDemo/android/settings.gradle index 450f9f27..029b95f7 100644 --- a/ReactNativeDemo/android/settings.gradle +++ b/ReactNativeDemo/android/settings.gradle @@ -1,3 +1,5 @@ rootProject.name = 'ReactNativeDemo' +include ':react-native-sentry' +project(':react-native-sentry').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sentry/android') include ':app' diff --git a/ReactNativeDemo/ios/ReactNativeDemo.xcodeproj/project.pbxproj b/ReactNativeDemo/ios/ReactNativeDemo.xcodeproj/project.pbxproj index 4e9ef22f..045b2cba 100644 --- a/ReactNativeDemo/ios/ReactNativeDemo.xcodeproj/project.pbxproj +++ b/ReactNativeDemo/ios/ReactNativeDemo.xcodeproj/project.pbxproj @@ -5,7 +5,6 @@ }; objectVersion = 46; objects = { - /* Begin PBXBuildFile section */ 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; @@ -40,6 +39,9 @@ ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; }; ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; }; ED2971652150620600B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2971642150620600B7C4FE /* JavaScriptCore.framework */; }; + 2A0B6FCF2D4040E89C2809C3 /* libRNSentry.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 02C4D22390E14D128480CFEB /* libRNSentry.a */; }; + 79AAFB8EDBFC426DB3EFF665 /* libRNSentry-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E05E6D957D6D4B06B1887155 /* libRNSentry-tvOS.a */; }; + 2A07FC79859A46C8871426F4 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 36E5853EC32A4E038062B231 /* libz.tbd */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -347,6 +349,10 @@ ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; + E8A63F7A50544A6290CF191A /* RNSentry.xcodeproj */ = {isa = PBXFileReference; name = "RNSentry.xcodeproj"; path = "../node_modules/react-native-sentry/ios/RNSentry.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; + 02C4D22390E14D128480CFEB /* libRNSentry.a */ = {isa = PBXFileReference; name = "libRNSentry.a"; path = "libRNSentry.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; + E05E6D957D6D4B06B1887155 /* libRNSentry-tvOS.a */ = {isa = PBXFileReference; name = "libRNSentry-tvOS.a"; path = "libRNSentry-tvOS.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; + 36E5853EC32A4E038062B231 /* libz.tbd */ = {isa = PBXFileReference; name = "libz.tbd"; path = "usr/lib/libz.tbd"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = sourcecode.text-based-dylib-definition; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -375,6 +381,8 @@ 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, + 2A0B6FCF2D4040E89C2809C3 /* libRNSentry.a in Frameworks */, + 2A07FC79859A46C8871426F4 /* libz.tbd in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -391,6 +399,7 @@ 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */, 2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */, 2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */, + 79AAFB8EDBFC426DB3EFF665 /* libRNSentry-tvOS.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -527,6 +536,7 @@ ED297162215061F000B7C4FE /* JavaScriptCore.framework */, ED2971642150620600B7C4FE /* JavaScriptCore.framework */, 2D16E6891FA4F8E400B85C8A /* libReact.a */, + 36E5853EC32A4E038062B231 /* libz.tbd */, ); name = Frameworks; sourceTree = ""; @@ -564,6 +574,7 @@ 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, + E8A63F7A50544A6290CF191A /* RNSentry.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -611,6 +622,14 @@ name = Products; sourceTree = ""; }; + DFB1E007DE0B48BCBA1ADC00 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + path = Application; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -640,6 +659,7 @@ 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, + 1867AED7630B4E57936F13D0 /* Upload Debug Symbols to Sentry */, ); buildRules = ( ); @@ -692,7 +712,7 @@ 83CBB9F71A601CBA00E9B192 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0940; + LastUpgradeCheck = 940; ORGANIZATIONNAME = Facebook; TargetAttributes = { 00E356ED1AD99517003FC87E = { @@ -1090,7 +1110,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; + shellScript = "export SENTRY_PROPERTIES=sentry.properties\nexport NODE_BINARY=node\n../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh"; }; 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = { isa = PBXShellScriptBuildPhase; @@ -1104,7 +1124,21 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; + shellScript = "export SENTRY_PROPERTIES=sentry.properties\nexport NODE_BINARY=node\n../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh"; + }; + 1867AED7630B4E57936F13D0 /* Upload Debug Symbols to Sentry */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + name = "Upload Debug Symbols to Sentry"; + inputPaths = ( + ); + outputPaths = ( + ); + shellPath = /bin/sh; + shellScript = "export SENTRY_PROPERTIES=sentry.properties\n../node_modules/@sentry/cli/bin/sentry-cli upload-dsym"; }; /* End PBXShellScriptBuildPhase section */ @@ -1189,6 +1223,15 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeDemo.app/ReactNativeDemo"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-sentry/ios/**", + ); }; name = Debug; }; @@ -1207,6 +1250,15 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeDemo.app/ReactNativeDemo"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-sentry/ios/**", + ); }; name = Release; }; @@ -1226,6 +1278,10 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = ReactNativeDemo; VERSIONING_SYSTEM = "apple-generic"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-sentry/ios/**", + ); }; name = Debug; }; @@ -1244,6 +1300,10 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = ReactNativeDemo; VERSIONING_SYSTEM = "apple-generic"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-sentry/ios/**", + ); }; name = Release; }; @@ -1270,6 +1330,15 @@ SDKROOT = appletvos; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.2; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-sentry/ios/**", + ); }; name = Debug; }; @@ -1296,6 +1365,15 @@ SDKROOT = appletvos; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.2; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-sentry/ios/**", + ); }; name = Release; }; @@ -1321,6 +1399,15 @@ SDKROOT = appletvos; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeDemo-tvOS.app/ReactNativeDemo-tvOS"; TVOS_DEPLOYMENT_TARGET = 10.1; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-sentry/ios/**", + ); }; name = Debug; }; @@ -1346,6 +1433,15 @@ SDKROOT = appletvos; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeDemo-tvOS.app/ReactNativeDemo-tvOS"; TVOS_DEPLOYMENT_TARGET = 10.1; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-sentry/ios/**", + ); }; name = Release; }; diff --git a/ReactNativeDemo/ios/ReactNativeDemo/AppDelegate.m b/ReactNativeDemo/ios/ReactNativeDemo/AppDelegate.m index 1202031c..63da4677 100644 --- a/ReactNativeDemo/ios/ReactNativeDemo/AppDelegate.m +++ b/ReactNativeDemo/ios/ReactNativeDemo/AppDelegate.m @@ -10,15 +10,21 @@ #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 @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; - RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge +RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"ReactNativeDemo" initialProperties:nil]; + [RNSentry installWithRootView:rootView]; rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; diff --git a/ReactNativeDemo/ios/sentry.properties b/ReactNativeDemo/ios/sentry.properties index 5c4c91dd..495ad93d 100644 --- a/ReactNativeDemo/ios/sentry.properties +++ b/ReactNativeDemo/ios/sentry.properties @@ -1,5 +1,4 @@ defaults.url=https://sentry.io/ defaults.org=testorg-az defaults.project=react-native-mobile -auth.token= -cli.executable=node_modules/@sentry/cli/bin/sentry-cli \ No newline at end of file +cli.executable=node_modules/@sentry/cli/bin/sentry-cli From f3d9019086ca58f47c4c5a35c9f4e360c51ac792 Mon Sep 17 00:00:00 2001 From: Neil Manvar Date: Mon, 15 Jul 2019 10:46:26 -0700 Subject: [PATCH 2/5] move .nvmrc to root --- ReactNativeDemo/.nvmrc => .nvmrc | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ReactNativeDemo/.nvmrc => .nvmrc (100%) diff --git a/ReactNativeDemo/.nvmrc b/.nvmrc similarity index 100% rename from ReactNativeDemo/.nvmrc rename to .nvmrc From 6f5485e284b189da0f51e637faffa099543ca779 Mon Sep 17 00:00:00 2001 From: Neil Manvar Date: Mon, 15 Jul 2019 10:55:01 -0700 Subject: [PATCH 3/5] clean up README. move up nvm use --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 299903e3..20c39f30 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,17 @@ https://docs.sentry.io/clients/react-native/ Show how Sentry works to surface errors in react-native applications (stacktraces will be symbolicated + unminified) ## Setup -1. Create a React Native project on Sentry.io -2. Install all dependencies (node, watchmen, JDK) listed under https://facebook.github.io/react-native/docs/getting-started.html#node-watchman-jdk -3. Install cocoapods (`gem install cocoapods`) -3. Install react-native-cli: `npm install -g react-native-cli@2.0.1` -4. `cd ReactNativeDemo` -5. Use nvm version specified in .nvmrc: `nvm use` +`2`. Install dependencies listed under https://facebook.github.io/react-native/docs/getting-started.html#node-watchman-jdk (all except for node): +``` +brew install watchman +brew tap AdoptOpenJDK/openjdk +brew cask install adoptopenjdk8 +``` +2. Install cocoapods (`gem install cocoapods`) +3. Use nvm version specified in .nvmrc: `nvm use` +4. Install react-native-cli: `npm install -g react-native-cli@2.0.1` +5. `cd ReactNativeDemo` 6. Install packages: `npm install` -7. Replace DSN in App.js with project's DSN -8. Replace org and project in ios/sentry.properties + android/sentry.properties # Run ### iOS: From 5baa8cc8c0dc4e808580c9398956d72742fed0c9 Mon Sep 17 00:00:00 2001 From: Neil Manvar Date: Mon, 15 Jul 2019 10:55:47 -0700 Subject: [PATCH 4/5] fix numbering in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 20c39f30..1451c7f0 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ https://docs.sentry.io/clients/react-native/ Show how Sentry works to surface errors in react-native applications (stacktraces will be symbolicated + unminified) ## Setup -`2`. Install dependencies listed under https://facebook.github.io/react-native/docs/getting-started.html#node-watchman-jdk (all except for node): +1. Install dependencies listed under https://facebook.github.io/react-native/docs/getting-started.html#node-watchman-jdk (all except for node): ``` brew install watchman brew tap AdoptOpenJDK/openjdk From 553b6b3a60d58aec2a4d90156d1e630d6739f098 Mon Sep 17 00:00:00 2001 From: Neil Manvar Date: Thu, 18 Jul 2019 17:51:16 -0700 Subject: [PATCH 5/5] SENTRY_AUTH_TOKEN env var must be set as not included in .properties --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1451c7f0..ab50ada4 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,10 @@ brew cask install adoptopenjdk8 4. Install react-native-cli: `npm install -g react-native-cli@2.0.1` 5. `cd ReactNativeDemo` 6. Install packages: `npm install` +7. Make sure `SENTRY_AUTH_TOKEN` environment variable is set (https://docs.sentry.io/cli/configuration/#to-authenticate-manually) # Run + ### iOS: ``` $ react-native run-ios --configuration Release