diff --git a/CHANGELOG.md b/CHANGELOG.md index a4b903904e..cb2c373d86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,9 +38,9 @@ Change `Cold/Warm App Start` span description to `Cold/Warm Start` ([#4636](http ### Dependencies -- Bump Android SDK from v7.20.1 to v7.22.0 ([#4529](https://github.com/getsentry/sentry-react-native/pull/4529)) - - [changelog](https://github.com/getsentry/sentry-java/blob/7.x.x/CHANGELOG.md#7220) - - [diff](https://github.com/getsentry/sentry-java/compare/7.20.1...7.22.0) +- Bump Android SDK from v7.20.1 to v8.3.0 ([#4490](https://github.com/getsentry/sentry-react-native/pull/4490)) + - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#830) + - [diff](https://github.com/getsentry/sentry-java/compare/7.20.1...8.3.0) - Bump Cocoa SDK from v8.44.0 to v8.45.0 ([#4537](https://github.com/getsentry/sentry-react-native/pull/4537)) - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8450) - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.44.0...8.45.0) diff --git a/packages/core/android/build.gradle b/packages/core/android/build.gradle index c96506fb3c..13d61a054b 100644 --- a/packages/core/android/build.gradle +++ b/packages/core/android/build.gradle @@ -54,5 +54,5 @@ android { dependencies { implementation 'com.facebook.react:react-native:+' - api 'io.sentry:sentry-android:7.22.0' + api 'io.sentry:sentry-android:8.3.0' } diff --git a/packages/core/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java b/packages/core/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java index 486ae72c48..0b626b3188 100644 --- a/packages/core/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +++ b/packages/core/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java @@ -29,12 +29,12 @@ import com.facebook.react.common.JavascriptException; import com.facebook.react.modules.core.DeviceEventManagerModule; import io.sentry.Breadcrumb; -import io.sentry.HubAdapter; import io.sentry.ILogger; import io.sentry.IScope; import io.sentry.ISentryExecutorService; import io.sentry.ISerializer; import io.sentry.Integration; +import io.sentry.ScopesAdapter; import io.sentry.Sentry; import io.sentry.SentryDate; import io.sentry.SentryDateProvider; @@ -85,6 +85,7 @@ import java.util.List; import java.util.Map; import java.util.Properties; +import java.util.Set; import java.util.concurrent.CountDownLatch; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -505,7 +506,7 @@ public void fetchNativeFrames(Promise promise) { } public void captureReplay(boolean isHardCrash, Promise promise) { - Sentry.getCurrentHub().getOptions().getReplayController().captureReplay(isHardCrash); + Sentry.getCurrentScopes().getOptions().getReplayController().captureReplay(isHardCrash); promise.resolve(getCurrentReplayId()); } @@ -601,7 +602,7 @@ public void fetchViewHierarchy(Promise promise) { return; } - ISerializer serializer = HubAdapter.getInstance().getOptions().getSerializer(); + ISerializer serializer = ScopesAdapter.getInstance().getOptions().getSerializer(); final @Nullable byte[] bytes = JsonSerializationUtils.bytesFrom(serializer, logger, viewHierarchy); if (bytes == null) { @@ -655,10 +656,6 @@ public void setUser(final ReadableMap userKeys, final ReadableMap userDataKeys) if (userKeys.hasKey("ip_address")) { userInstance.setIpAddress(userKeys.getString("ip_address")); } - - if (userKeys.hasKey("segment")) { - userInstance.setSegment(userKeys.getString("segment")); - } } if (userDataKeys != null) { @@ -807,8 +804,7 @@ private void initializeAndroidProfiler() { (int) SECONDS.toMicros(1) / profilingTracesHz, new SentryFrameMetricsCollector(reactApplicationContext, logger, buildInfo), executorService, - logger, - buildInfo); + logger); } public WritableMap startProfiling(boolean platformProfilers) { @@ -832,7 +828,7 @@ public WritableMap startProfiling(boolean platformProfilers) { } public WritableMap stopProfiling() { - final boolean isDebug = HubAdapter.getInstance().getOptions().isDebug(); + final boolean isDebug = ScopesAdapter.getInstance().getOptions().isDebug(); final WritableMap result = new WritableNativeMap(); File output = null; try { @@ -918,7 +914,7 @@ private String readStringFromFile(File path) throws IOException { } public void fetchNativeDeviceContexts(Promise promise) { - final @NotNull SentryOptions options = HubAdapter.getInstance().getOptions(); + final @NotNull SentryOptions options = ScopesAdapter.getInstance().getOptions(); final @Nullable Context context = this.getReactApplicationContext().getApplicationContext(); final @Nullable IScope currentScope = InternalSentrySdk.getCurrentScope(); fetchNativeDeviceContexts(promise, options, context, currentScope); @@ -955,7 +951,8 @@ protected void fetchNativeDeviceContexts( } public void fetchNativeSdkInfo(Promise promise) { - final @Nullable SdkVersion sdkVersion = HubAdapter.getInstance().getOptions().getSdkVersion(); + final @Nullable SdkVersion sdkVersion = + ScopesAdapter.getInstance().getOptions().getSdkVersion(); if (sdkVersion == null) { promise.resolve(null); } else { @@ -1001,14 +998,14 @@ private void addPackages(SentryEvent event, SdkVersion sdk) { if (eventSdk != null && "sentry.javascript.react-native".equals(eventSdk.getName()) && sdk != null) { - List sentryPackages = sdk.getPackages(); + Set sentryPackages = sdk.getPackageSet(); if (sentryPackages != null) { for (SentryPackage sentryPackage : sentryPackages) { eventSdk.addPackage(sentryPackage.getName(), sentryPackage.getVersion()); } } - List integrations = sdk.getIntegrations(); + Set integrations = sdk.getIntegrationSet(); if (integrations != null) { for (String integration : integrations) { eventSdk.addIntegration(integration);