Skip to content

Firebase Performance app_start not firing in SwiftUI apps #15802

@bcootner

Description

@bcootner

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions