Skip to content

Commit a5a8f89

Browse files
fix(android): Pass sampleRate option to the Android SDK (#3979)
1 parent c74b4c2 commit a5a8f89

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Fixes
66

7+
- Pass `sampleRate` option to the Android SDK ([#3979](https://github.com/getsentry/sentry-react-native/pull/3979))
78
- Drop app start data older than one minute ([#3974](https://github.com/getsentry/sentry-react-native/pull/3974))
89

910
### Dependencies

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ public void initNativeSdk(final ReadableMap rnOptions, Promise promise) {
203203
// SentryAndroid needs an empty string fallback for the dsn.
204204
options.setDsn("");
205205
}
206+
if (rnOptions.hasKey("sampleRate")) {
207+
options.setSampleRate(rnOptions.getDouble("sampleRate"));
208+
}
206209
if (rnOptions.hasKey("sendClientReports")) {
207210
options.setSendClientReports(rnOptions.getBoolean("sendClientReports"));
208211
}

0 commit comments

Comments
 (0)