@@ -64,7 +64,9 @@ public Map<String, Object> getConstants() {
64
64
public void startWithOptions (final ReadableMap rnOptions , Promise promise ) {
65
65
SentryAndroid .init (this .getReactApplicationContext (), options -> {
66
66
if (rnOptions .hasKey ("dsn" ) && rnOptions .getString ("dsn" ) != null ) {
67
- options .setDsn (rnOptions .getString ("dsn" ));
67
+ String dsn = rnOptions .getString ("dsn" );
68
+ logger .info (String .format ("Starting with DSN: '%s'" , dsn ));
69
+ options .setDsn (dsn );
68
70
} else {
69
71
// SentryAndroid needs an empty string fallback for the dsn.
70
72
options .setDsn ("" );
@@ -82,6 +84,10 @@ public void startWithOptions(final ReadableMap rnOptions, Promise promise) {
82
84
options .setDist (rnOptions .getString ("dist" ));
83
85
}
84
86
87
+ // JS use top level stacktraces and android attaches Threads which hides them so by default we hide.
88
+ boolean attachThreads = rnOptions .hasKey ("attachThreads" ) && rnOptions .getBoolean ("attachThreads" );
89
+ options .setAttachThreads (attachThreads );
90
+
85
91
options .setBeforeSend ((event , hint ) -> {
86
92
// React native internally throws a JavascriptException
87
93
// Since we catch it before that, we don't want to send this one
@@ -112,10 +118,6 @@ public void startWithOptions(final ReadableMap rnOptions, Promise promise) {
112
118
sentryOptions = options ;
113
119
});
114
120
115
- if (rnOptions .hasKey ("dsn" )) {
116
- logger .info (String .format ("startWithDsnString '%s'" , rnOptions .getString ("dsn" )));
117
- }
118
-
119
121
promise .resolve (true );
120
122
}
121
123
0 commit comments