Skip to content

Commit 2c394d1

Browse files
feat(android): Add enableNdk to rn options (#3304)
1 parent 5fefdf7 commit 2c394d1

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

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

1011
## 5.9.2
1112

android/src/main/java/io/sentry/react/RNSentryModuleImpl.java

+3
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ public void initNativeSdk(final ReadableMap rnOptions, Promise promise) {
185185
if (rnOptions.hasKey("maxQueueSize")) {
186186
options.setMaxQueueSize(rnOptions.getInt("maxQueueSize"));
187187
}
188+
if (rnOptions.hasKey("enableNdk")) {
189+
options.setEnableNdk(rnOptions.getBoolean("enableNdk"));
190+
}
188191

189192
options.setBeforeSend((event, hint) -> {
190193
// React native internally throws a JavascriptException

src/js/options.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,15 @@ export interface BaseReactNativeOptions {
4141
/** The interval to end a session if the App goes to the background. */
4242
sessionTrackingIntervalMillis?: number;
4343

44-
/** Enable scope sync from Java to NDK on Android */
44+
/** Enable NDK on Android
45+
*
46+
* @default true
47+
*/
48+
enableNdk?: boolean;
49+
50+
/** Enable scope sync from Java to NDK on Android
51+
* Only has an effect if `enableNdk` is `true`.
52+
*/
4553
enableNdkScopeSync?: boolean;
4654

4755
/** When enabled, all the threads are automatically attached to all logged events on Android */

src/js/sdk.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const DEFAULT_OPTIONS: ReactNativeOptions = {
5555
maxQueueSize: DEFAULT_BUFFER_SIZE,
5656
attachStacktrace: true,
5757
enableCaptureFailedRequests: false,
58+
enableNdk: true,
5859
};
5960

6061
/**

0 commit comments

Comments
 (0)