|
10 | 10 | import android.util.SparseIntArray;
|
11 | 11 |
|
12 | 12 | import androidx.annotation.Nullable;
|
| 13 | +import androidx.annotation.NonNull; |
13 | 14 | import androidx.core.app.FrameMetricsAggregator;
|
14 | 15 |
|
15 | 16 | import com.facebook.react.bridge.Arguments;
|
|
51 | 52 | import io.sentry.android.core.AndroidLogger;
|
52 | 53 | import io.sentry.android.core.AnrIntegration;
|
53 | 54 | import io.sentry.android.core.AppStartState;
|
| 55 | +import io.sentry.android.core.BuildConfig; |
54 | 56 | import io.sentry.android.core.BuildInfoProvider;
|
55 | 57 | import io.sentry.android.core.CurrentActivityHolder;
|
56 | 58 | import io.sentry.android.core.NdkIntegration;
|
@@ -102,6 +104,17 @@ Activity getCurrentActivity() {
|
102 | 104 |
|
103 | 105 | public void initNativeSdk(final ReadableMap rnOptions, Promise promise) {
|
104 | 106 | SentryAndroid.init(this.getReactApplicationContext(), options -> {
|
| 107 | + @NonNull final String sdkName = "sentry.java.android.react-native"; |
| 108 | + @Nullable SdkVersion sdkVersion = options.getSdkVersion(); |
| 109 | + if (sdkVersion == null) { |
| 110 | + sdkVersion = new SdkVersion(sdkName, BuildConfig.VERSION_NAME); |
| 111 | + } else { |
| 112 | + sdkVersion.setName(sdkName); |
| 113 | + } |
| 114 | + |
| 115 | + options.setSentryClientName(sdkVersion.getName() + "/" + sdkVersion.getVersion()); |
| 116 | + options.setSdkVersion(sdkVersion); |
| 117 | + |
105 | 118 | if (rnOptions.hasKey("debug") && rnOptions.getBoolean("debug")) {
|
106 | 119 | options.setDebug(true);
|
107 | 120 | }
|
|
0 commit comments