-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
Description
Firebase Performance app_start does not fire in SwiftUI apps using @UIApplicationDelegateAdaptor because launch state is checked too early. In SwiftUI lifecycle apps (@main App + @UIApplicationDelegateAdaptor), didFinishLaunchingWithOptions can execute before any foreground scene is active, and applicationState can still report .background at that moment.
Firebase Performance checks state == UIApplicationStateBackground during didFinishLaunchingWithOptions notification handling, and incorrectly classify normal foreground launches as background launches and invalidates app_start. In SwiftUI apps, this callback is a poor place to determine whether launch was truly background
Reproducing the issue
- Create a new SwiftUI iOS app., disabled swizzling in Info.plist
- Add Firebase Core + Firebase Performance.
- Configure Firebase in application(_:didFinishLaunchingWithOptions:) via @UIApplicationDelegateAdaptor.
- Launch app normally from Xcode (foreground launch).
- Observe debug logging and/or Performance traces in Firebase console
"12.8.0 - [FirebasePerformance][I-PRF200007] Background launch detected. App start measurement will be skipped."
Firebase SDK Version
12.8.0
Xcode Version
26.3
Installation Method
Swift Package Manager
Firebase Product(s)
Performance
Targeted Platforms
iOS
Relevant Log Output
"12.8.0 - [FirebasePerformance][I-PRF200007] Background launch detected. App start measurement will be skipped."If using Swift Package Manager, the project's Package.resolved
No response
If using CocoaPods, the project's Podfile.lock
No response
Reactions are currently unavailable