Skip to content

Commit ad19701

Browse files
authored
fix SR iOS issue (#5560)
1 parent 7c7a53e commit ad19701

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/core/ios/RNSentryStart.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#import "RNSentryStart.h"
2+
#import "RNSentryExperimentalOptions.h"
23
#import "RNSentryReplay.h"
34
#import "RNSentryVersion.h"
45

@@ -40,7 +41,9 @@ + (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull)
4041
NSMutableDictionary *mutableOptions = [options mutableCopy];
4142

4243
#if SENTRY_TARGET_REPLAY_SUPPORTED
43-
[RNSentryReplay updateOptions:mutableOptions];
44+
BOOL isSessionReplayEnabled = [RNSentryReplay updateOptions:mutableOptions];
45+
#else
46+
BOOL isSessionReplayEnabled = NO;
4447
#endif
4548

4649
SentryOptions *sentryOptions = [SentryOptionsInternal initWithDict:mutableOptions
@@ -96,6 +99,11 @@ + (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull)
9699
}
97100
}
98101

102+
if (isSessionReplayEnabled) {
103+
[RNSentryExperimentalOptions setEnableSessionReplayInUnreliableEnvironment:YES
104+
sentryOptions:sentryOptions];
105+
}
106+
99107
return sentryOptions;
100108
}
101109

0 commit comments

Comments
 (0)