|
29 | 29 | import com.facebook.react.common.JavascriptException; |
30 | 30 | import com.facebook.react.modules.core.DeviceEventManagerModule; |
31 | 31 | import io.sentry.Breadcrumb; |
32 | | -import io.sentry.HubAdapter; |
33 | 32 | import io.sentry.ILogger; |
34 | 33 | import io.sentry.IScope; |
35 | 34 | import io.sentry.ISentryExecutorService; |
36 | 35 | import io.sentry.ISerializer; |
37 | 36 | import io.sentry.Integration; |
| 37 | +import io.sentry.ScopesAdapter; |
38 | 38 | import io.sentry.Sentry; |
39 | 39 | import io.sentry.SentryDate; |
40 | 40 | import io.sentry.SentryDateProvider; |
@@ -506,7 +506,7 @@ public void fetchNativeFrames(Promise promise) { |
506 | 506 | } |
507 | 507 |
|
508 | 508 | public void captureReplay(boolean isHardCrash, Promise promise) { |
509 | | - Sentry.getCurrentHub().getOptions().getReplayController().captureReplay(isHardCrash); |
| 509 | + Sentry.getCurrentScopes().getOptions().getReplayController().captureReplay(isHardCrash); |
510 | 510 | promise.resolve(getCurrentReplayId()); |
511 | 511 | } |
512 | 512 |
|
@@ -602,7 +602,7 @@ public void fetchViewHierarchy(Promise promise) { |
602 | 602 | return; |
603 | 603 | } |
604 | 604 |
|
605 | | - ISerializer serializer = HubAdapter.getInstance().getOptions().getSerializer(); |
| 605 | + ISerializer serializer = ScopesAdapter.getInstance().getOptions().getSerializer(); |
606 | 606 | final @Nullable byte[] bytes = |
607 | 607 | JsonSerializationUtils.bytesFrom(serializer, logger, viewHierarchy); |
608 | 608 | if (bytes == null) { |
@@ -828,7 +828,7 @@ public WritableMap startProfiling(boolean platformProfilers) { |
828 | 828 | } |
829 | 829 |
|
830 | 830 | public WritableMap stopProfiling() { |
831 | | - final boolean isDebug = HubAdapter.getInstance().getOptions().isDebug(); |
| 831 | + final boolean isDebug = ScopesAdapter.getInstance().getOptions().isDebug(); |
832 | 832 | final WritableMap result = new WritableNativeMap(); |
833 | 833 | File output = null; |
834 | 834 | try { |
@@ -914,7 +914,7 @@ private String readStringFromFile(File path) throws IOException { |
914 | 914 | } |
915 | 915 |
|
916 | 916 | public void fetchNativeDeviceContexts(Promise promise) { |
917 | | - final @NotNull SentryOptions options = HubAdapter.getInstance().getOptions(); |
| 917 | + final @NotNull SentryOptions options = ScopesAdapter.getInstance().getOptions(); |
918 | 918 | final @Nullable Context context = this.getReactApplicationContext().getApplicationContext(); |
919 | 919 | final @Nullable IScope currentScope = InternalSentrySdk.getCurrentScope(); |
920 | 920 | fetchNativeDeviceContexts(promise, options, context, currentScope); |
@@ -951,7 +951,8 @@ protected void fetchNativeDeviceContexts( |
951 | 951 | } |
952 | 952 |
|
953 | 953 | public void fetchNativeSdkInfo(Promise promise) { |
954 | | - final @Nullable SdkVersion sdkVersion = HubAdapter.getInstance().getOptions().getSdkVersion(); |
| 954 | + final @Nullable SdkVersion sdkVersion = |
| 955 | + ScopesAdapter.getInstance().getOptions().getSdkVersion(); |
955 | 956 | if (sdkVersion == null) { |
956 | 957 | promise.resolve(null); |
957 | 958 | } else { |
|
0 commit comments