Skip to content

Commit

Permalink
feat(android): Add enableNdk to rn options (#3304)
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich authored Sep 27, 2023
1 parent 5fefdf7 commit 2c394d1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Add Hermes Debug Info flag to React Native Context ([#3290](https://github.com/getsentry/sentry-react-native/pull/3290))
- This flag equals `true` when Hermes Bundle contains Debug Info (Hermes Source Map was not emitted)
- Add `enableNdk` property to ReactNativeOptions for Android. ([#3304](https://github.com/getsentry/sentry-react-native/pull/3304))

## 5.9.2

Expand Down
3 changes: 3 additions & 0 deletions android/src/main/java/io/sentry/react/RNSentryModuleImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ public void initNativeSdk(final ReadableMap rnOptions, Promise promise) {
if (rnOptions.hasKey("maxQueueSize")) {
options.setMaxQueueSize(rnOptions.getInt("maxQueueSize"));
}
if (rnOptions.hasKey("enableNdk")) {
options.setEnableNdk(rnOptions.getBoolean("enableNdk"));
}

options.setBeforeSend((event, hint) -> {
// React native internally throws a JavascriptException
Expand Down
10 changes: 9 additions & 1 deletion src/js/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,15 @@ export interface BaseReactNativeOptions {
/** The interval to end a session if the App goes to the background. */
sessionTrackingIntervalMillis?: number;

/** Enable scope sync from Java to NDK on Android */
/** Enable NDK on Android
*
* @default true
*/
enableNdk?: boolean;

/** Enable scope sync from Java to NDK on Android
* Only has an effect if `enableNdk` is `true`.
*/
enableNdkScopeSync?: boolean;

/** When enabled, all the threads are automatically attached to all logged events on Android */
Expand Down
1 change: 1 addition & 0 deletions src/js/sdk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const DEFAULT_OPTIONS: ReactNativeOptions = {
maxQueueSize: DEFAULT_BUFFER_SIZE,
attachStacktrace: true,
enableCaptureFailedRequests: false,
enableNdk: true,
};

/**
Expand Down

0 comments on commit 2c394d1

Please sign in to comment.