From 8dac8f316be3adb047a521cf34583bbf0b2bfdec Mon Sep 17 00:00:00 2001 From: Noah Martin Date: Wed, 19 Nov 2025 15:56:39 -0500 Subject: [PATCH] Auto start app launch --- Sources/Sentry/SentryAppStartTracker.m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Sources/Sentry/SentryAppStartTracker.m b/Sources/Sentry/SentryAppStartTracker.m index 1e939b43fa8..74936a038a2 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