-
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'capture-app-start-errors' into kw-read-options-in-js
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,44 @@ | |
## Unreleased | ||
|
||
### Features | ||
|
||
- Capture App Start errors and crashes by initializing Sentry from `sentry.options.json` ([#4472](https://github.com/getsentry/sentry-react-native/pull/4472)) | ||
|
||
Create `sentry.options.json` in the React Native project root and set options the same as you currently have in `Sentry.init` in JS. | ||
|
||
```json | ||
{ | ||
"dsn": "https://[email protected]/value", | ||
} | ||
``` | ||
|
||
Initialize Sentry on the native layers by newly provided native methods. | ||
|
||
```kotlin | ||
import io.sentry.react.RNSentrySDK | ||
|
||
class MainApplication : Application(), ReactApplication { | ||
override fun onCreate() { | ||
super.onCreate() | ||
RNSentrySDK.init(this) | ||
} | ||
} | ||
``` | ||
|
||
```obj-c | ||
#import <RNSentry/RNSentry.h> | ||
|
||
@implementation AppDelegate | ||
- (BOOL)application:(UIApplication *)application | ||
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | ||
{ | ||
[RNSentrySDK start]; | ||
return [super application:application didFinishLaunchingWithOptions:launchOptions]; | ||
} | ||
@end | ||
``` | ||
### Changes | ||
- Load `optionsFile` into the JS bundle during Metro bundle process ([#4476](https://github.com/getsentry/sentry-react-native/pull/4476)) | ||
|