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; }