diff --git a/Sources/Sentry/SentryAppStartTracker.m b/Sources/Sentry/SentryAppStartTracker.m index 1e939b43fa..74936a038a 100644 --- a/Sources/Sentry/SentryAppStartTracker.m +++ b/Sources/Sentry/SentryAppStartTracker.m @@ -9,6 +9,10 @@ # import # import # import +#import "SentryTracerConfiguration.h" +#import "SentrySDKInternal.h" +#import "SentryHub+Private.h" +#import "SentryTracer.h" # import # import # import @@ -206,6 +210,18 @@ - (void)buildAppStartMeasurement:(NSDate *)appStartEnd didFinishLaunchingTimestamp:self.didFinishLaunchingTimestamp]; SentrySDKInternal.appStartMeasurement = appStartMeasurement; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + SentryTransactionContext *ctx = [[SentryTransactionContext alloc] initWithName:@"App Launch" operation:@"ui.load"]; + SentryTracer *transaction = [SentrySDKInternal.currentHub + startTransactionWithContext:ctx + bindToScope:YES + customSamplingContext:@{} + configuration:[SentryTracerConfiguration configurationWithBlock:^( + SentryTracerConfiguration *config) { + config.waitForChildren = YES; + }]]; + [transaction finish]; + }); }; // With only running this once we know that the process is a new one when the following