From 2fe8a77ca27341f1c89967d740d99fbc2269cdd4 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Tue, 20 Jan 2026 17:20:12 +0100 Subject: [PATCH] fix SR iOS issue --- packages/core/ios/RNSentryStart.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/core/ios/RNSentryStart.m b/packages/core/ios/RNSentryStart.m index d40ac63ac0..ce9c46e8bc 100644 --- a/packages/core/ios/RNSentryStart.m +++ b/packages/core/ios/RNSentryStart.m @@ -1,4 +1,5 @@ #import "RNSentryStart.h" +#import "RNSentryExperimentalOptions.h" #import "RNSentryReplay.h" #import "RNSentryVersion.h" @@ -40,7 +41,9 @@ + (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull) NSMutableDictionary *mutableOptions = [options mutableCopy]; #if SENTRY_TARGET_REPLAY_SUPPORTED - [RNSentryReplay updateOptions:mutableOptions]; + BOOL isSessionReplayEnabled = [RNSentryReplay updateOptions:mutableOptions]; +#else + BOOL isSessionReplayEnabled = NO; #endif SentryOptions *sentryOptions = [SentryOptionsInternal initWithDict:mutableOptions @@ -96,6 +99,11 @@ + (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull) } } + if (isSessionReplayEnabled) { + [RNSentryExperimentalOptions setEnableSessionReplayInUnreliableEnvironment:YES + sentryOptions:sentryOptions]; + } + return sentryOptions; }