Skip to content

firebase_auth: UIScene lifecycle support is not working #18383

Description

@MirceaX2Mobile

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Auth

Which platforms are affected?

iOS

Description

Flutter still prints the deprecated-lifecycle warning for FLTFirebaseAuthPlugin on the latest firebase_auth (6.5.3), which
includes the UIScene migration from #18054:

Plugin FLTFirebaseAuthPlugin uses deprecated application lifecycle events. Please contact plugin maintainers and request UIScene
lifecycle support. This will be required in a future version of Flutter. See
https://docs.flutter.dev/release/breaking-changes/uiscenedelegate#migration-guide-for-flutter-plugins

This is not the stale-version scenario diagnosed in similar reports ("another package depends on an older firebase_auth"). In my
app:

  • firebase_auth is a direct dependency resolved at 6.5.3 (single version in the graph — verified in pubspec.lock and flutter pub deps);
  • the compiled iOS source is .symlinks/plugins/firebase_auth → ~/.pub-cache/hosted/pub.dev/firebase_auth-6.5.3/ and the pod is
    locked at 6.5.3;
  • FLTFirebaseAuthPlugin is defined nowhere else in the build.

Root cause

In FLTFirebaseAuthPlugin.h, the FlutterSceneLifeCycleDelegate conformance added by #18054 is gated behind:

#if __has_include(<Flutter/FlutterSceneLifeCycleDelegate.h>) || \
    defined(FlutterSceneLifeCycleDelegate)
                         ,
                         FlutterSceneLifeCycleDelegate
#endif

Both arms of this condition are always false, on every Flutter version that exists:

  1. The engine has never shipped a header named FlutterSceneLifeCycleDelegate.h. On Flutter 3.44.2 stable,
    Flutter.xcframework/ios-arm64/Flutter.framework/Headers/ contains FlutterSceneLifeCycle.h and FlutterSceneDelegate.h; the
    FlutterSceneLifeCycleDelegate protocol is declared in FlutterSceneLifeCycle.h (imported by FlutterPlugin.h). The same is
    true on current master (engine/src/flutter/shell/platform/darwin/ios/framework/Headers/), so this cannot be fixed by upgrading
    Flutter.
  2. defined(FlutterSceneLifeCycleDelegate) tests a preprocessor macro. Nothing defines one with that name — the @protocol FlutterSceneLifeCycleDelegate; forward declaration in the same header is not a macro, and the podspecs'
    GCC_PREPROCESSOR_DEFINITIONS only set LIBRARY_VERSION / LIBRARY_NAME.

As a result the protocol conformance is compiled out, conformsToProtocol: fails at runtime, and the engine prints the warning —
even though scene:openURLContexts: and the addSceneDelegate: registration are present in FLTFirebaseAuthPlugin.m. The migration
code exists but can never activate.

Supporting evidence

On the same app and engine, flutter_facebook_auth 7.1.7 declares FlutterSceneLifeCycleDelegate conformance unconditionally
(Swift) — and its deprecated-lifecycle warning disappeared after upgrading. This confirms the engine keys the warning on the declared
protocol conformance.

The same dead gate exists in other plugins

FLTFirebaseMessagingPlugin.h carries the identical conditional (lines 57 and 66, in both the ios/ and macos/ copies). Please
audit the whole repo for this pattern — every ObjC plugin migrated with it has non-functional UIScene support.

Suggested fix

#if __has_include(<Flutter/FlutterSceneLifeCycle.h>)

(or drop the gate entirely once the minimum supported Flutter ships the scene API).

Environment

  • Flutter 3.44.2 (stable)
  • iOS, CocoaPods integration (SwiftPM disabled)

Reproducing the issue

Steps to reproduce

  1. flutter create an app on Flutter 3.44.2 stable, add firebase_auth: ^6.5.3.
  2. Run on iOS.
  3. Observe Plugin FLTFirebaseAuthPlugin uses deprecated application lifecycle events… in the console, despite feat(ios): migrate iOS to UIScene lifecycle #18054 being included
    in this release.

Firebase Core version

4.11.0

Flutter Version

3.44.2

Relevant Log Output

Plugin FLTFirebaseAuthPlugin uses deprecated application lifecycle events. Please contact plugin maintainers and request UIScene lifecycle support. This will be required in a future version of Flutter.

Flutter dependencies

Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.

Additional context and comments

No response

Metadata

Metadata

Assignees

Labels

Needs AttentionThis issue needs maintainer attention.platform: iosIssues / PRs which are specifically for iOS.plugin: authtype: bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions