Skip to content

feat(android): Add enableNdk to rn options #3304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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