Skip to content

Commit ae7b03d

Browse files
chore: Initialize RNSentryTimeToDisplay during native module init on iOS (#4443)
1 parent 8d251c2 commit ae7b03d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
- Rename `navigation.processing` span to more expressive `Navigation dispatch to screen A mounted/navigation cancelled` ([#4423](https://github.com/getsentry/sentry-react-native/pull/4423))
1818
- Add RN SDK package to `sdk.packages` for Cocoa ([#4381](https://github.com/getsentry/sentry-react-native/pull/4381))
1919

20+
### Internal
21+
22+
- Initialize `RNSentryTimeToDisplay` during native module `init` on iOS ([#4443](https://github.com/getsentry/sentry-react-native/pull/4443))
23+
2024
### Dependencies
2125

2226
- Bump CLI from v2.39.1 to v2.40.0 ([#4412](https://github.com/getsentry/sentry-react-native/pull/4412))

packages/core/ios/RNSentry.mm

+8-2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ + (BOOL)requiresMainQueueSetup
7878
return YES;
7979
}
8080

81+
- (instancetype)init
82+
{
83+
if (self = [super init]) {
84+
_timeToDisplay = [[RNSentryTimeToDisplay alloc] init];
85+
}
86+
return self;
87+
}
88+
8189
RCT_EXPORT_MODULE()
8290

8391
RCT_EXPORT_METHOD(initNativeSdk
@@ -152,8 +160,6 @@ - (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull)
152160
[mutableOptions removeObjectForKey:@"tracesSampler"];
153161
[mutableOptions removeObjectForKey:@"enableTracing"];
154162

155-
_timeToDisplay = [[RNSentryTimeToDisplay alloc] init];
156-
157163
#if SENTRY_TARGET_REPLAY_SUPPORTED
158164
[RNSentryReplay updateOptions:mutableOptions];
159165
#endif

0 commit comments

Comments
 (0)