Skip to content

Commit d1bfbde

Browse files
fix(android): Pass enabled option to native (#5334)
* fix(android): Pass enabled option to native * Add changelog * Update CHANGELOG.md Co-authored-by: LucasZF <[email protected]> --------- Co-authored-by: LucasZF <[email protected]>
1 parent 526494a commit d1bfbde

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
99
## Unreleased
1010

11+
### Fixes
12+
13+
- Android SDK not being disabled when `options.enabled` is set to `false` ([#5334](https://github.com/getsentry/sentry-react-native/pull/5334))
14+
1115
### Dependencies
1216

1317
- Bump JavaScript SDK from v10.22.0 to v10.23.0 ([#5335](https://github.com/getsentry/sentry-react-native/pull/5335))

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ protected void getSentryAndroidOptions(
242242
if (rnOptions.hasKey("debug") && rnOptions.getBoolean("debug")) {
243243
options.setDebug(true);
244244
}
245+
if (rnOptions.hasKey("enabled")) {
246+
options.setEnabled(rnOptions.getBoolean("enabled"));
247+
}
245248
if (rnOptions.hasKey("dsn") && rnOptions.getString("dsn") != null) {
246249
String dsn = rnOptions.getString("dsn");
247250
logger.log(SentryLevel.INFO, String.format("Starting with DSN: '%s'", dsn));

0 commit comments

Comments
 (0)