Uh oh!
There was an error while loading. Please reload this page.
feat(firebase): tvOS support for Core, Auth, Firestore, Storage, Messaging - #3
Conversation
efe227b to
8acb66eCompare…torage, Messaging Federated `*_tvos` packages bringing Firebase to Apple TV via the flutter-tvos toolchain, built on the Firebase Apple SDK (tvOS supported since 8.9.0): - firebase_core_tvos — full support - cloud_firestore_tvos — full support - firebase_storage_tvos — full support - firebase_auth_tvos — anonymous, email/password, email-link, Sign in with Apple, custom-token. MFA / phone / browser-OAuth / reCAPTCHA return `unsupported-platform` (absent from the Firebase tvOS SDK). - firebase_messaging_tvos — token / topic / permission. Rich-notification payload and interaction APIs are unavailable on tvOS. Each package re-exports the upstream Dart API and supplies the native tvOS pluginClass; the four leaf packages depend on firebase_core_tvos. Runtime-verified on the tvOS simulator and a physical Apple TV in AOT mode: core/auth/firestore perform live round-trips, storage/messaging execute and surface the expected backend/APNs errors. See each package's PORTING_REPORT.md for the native changes and tvOS support matrix.
8acb66e to
222313aCompare
DenisovAV
left a comment
There was a problem hiding this comment.
Review — firebase tvOS plugins
Verdict: APPROVE WITH CHANGES. The engineering is sound and unusually well-verified — live round-trips on the simulator and a physical Apple TV 4K under AOT. Native Firebase SDK version alignment (all podspecs → 12.15.0, matching upstream FlutterFire's firebase_sdk_version.rb), the Pigeon wire ABI (v26.3.4), the auth launch-crash fix (all 49 HostApi selectors have a tvOS-reachable impl, MFA/TOTP kept as unsupported-platform stubs), import repointing, and the pluginClass-only Dart shape are all verified clean. Nice work.
There is one silent-failure class worth fixing before publish, plus a couple of packaging/docs items.
Should fix before publish
Phone-auth returns
completion(nil, nil)on tvOS → deterministicnull-erroron the Dart side.verifyPhoneNumberAppandupdatePhoneNumberAppcallcompletion(nil, nil)on tvOS, unlike every other disabled path (MFA/TOTP/OAuth/reCAPTCHA), which returns anunsupported-platformFlutterError. The Pigeon return types here are non-nullable (Future<String>/InternalUserDetails), so a nil reply throwsPlatformException(code: 'null-error', ...)— the app gets an opaque error instead of "phone auth is unsupported on tvOS," and no verification callback fires. This also contradicts the PORTING_REPORT, which describes phone verification as disabled like the MFA stubs (which returnunsupported-platform). Fix is ~4 lines each — mirror the sibling MFA stub 30 lines away. Inline comments below.Missing
pubspec_overrides.yaml. The four leaf packages declarefirebase_core_tvos: ^0.0.1as a hosted constraint with a comment saying local dev resolves it viapubspec_overrides.yaml— but no such file exists anywhere in the PR. Example apps are fine (they usepath:deps), but a bareflutter pub get/pub publish --dry-runinside a leaf package can't resolve unpublishedfirebase_core_tvos 0.0.1. Either commit the overrides or document local creation + the intended publish order (core first).
Nice to have
- Auth README marks methods ✅ that were only compile-verified; the PORTING_REPORT only runtime-verified
signInAnonymouslyend-to-end. Consider annotating runtime-verified vs. compile-only rows. onMessage/onMessageOpenedApp/getInitialMessageare silent no-ops on tvOS for real SDK reasons (no hang — completions fire,getInitialMessage→ nil). Documented in the PORTING_REPORT; worth an explicit consumer-facing note that these streams never emit on tvOS.- Storage/messaging examples pin deps with no tvOS impl (
image_picker,flutter_local_notifications); worth aflutter pub getto confirm they still resolve against the pinned SDK (the auth example already hit this withfont_awesome_flutter).
Minor polish (dead capturedCompletion locals, ~> vs = podspec pins, placeholder tests, inaccurate false_secrets: comments) noted but not blocking.
Full report with the passed-checks list is in the maintainer's docs/pr-reviews/.
| #if TARGET_OS_OSX || TARGET_OS_TV | ||
| NSLog(@"The Firebase Phone Authentication provider is not supported on this " | ||
| @"platform."); | ||
| completion(nil, nil); |
There was a problem hiding this comment.
Silent failure on tvOS.completion(nil, nil) reports success with a nil result. The Pigeon Dart return type for verifyPhoneNumber is non-nullable Future<String> (the event-channel name the codeSent/verificationCompleted/verificationFailed callbacks subscribe to), so a nil reply deterministically throws PlatformException(code: 'null-error', message: 'Host platform returned null value for non-null return value.'). The app never learns phone auth is unsupported — it gets an opaque error and no callback fires.
Every other disabled path here (MFA/TOTP/OAuth/reCAPTCHA) already returns an unsupported-platformFlutterError. Mirror them:
completion(nil, [FlutterError errorWithCode:@"unsupported-platform"message:@"Phone number verification is not supported by the Firebase SDK on tvOS."details:nil]);There was a problem hiding this comment.
✅ Resolved in 26b67fc — now returns the unsupported-platformFlutterError. Verified against the diff.
| NSLog(@"Updating a users phone number via Firebase Authentication is only " | ||
| @"supported on the iOS " | ||
| @"platform."); | ||
| completion(nil, nil); |
There was a problem hiding this comment.
Same silent-failure pattern as verifyPhoneNumberApp. The port added && !TARGET_OS_TV to the #if TARGET_OS_IPHONE guard; since tvOS isTARGET_OS_IPHONE, this is a genuine new divergence (tvOS previously took the real branch). The Pigeon return type is non-nullable InternalUserDetails, so completion(nil, nil) produces the same deterministic null-error throw on the Dart side.
Return an unsupported-platformFlutterError here too, matching the sibling stubs.
There was a problem hiding this comment.
✅ Resolved in 26b67fc — now returns the unsupported-platformFlutterError. Verified against the diff.
| #else | ||
| NSLog(@"The Firebase Phone Authentication provider is not supported on this " | ||
| @"platform."); | ||
| completion(nil, nil); |
There was a problem hiding this comment.
Milder variant (optional). This branch also returns completion(nil, nil), but here it does not throw — every caller (signInWithCredential/linkWithCredential/reauthenticateWithCredentialApp) guards if (credential == nil) and surfaces invalid-credential. So it fails gracefully, but the surfaced error implies "you passed bad data" rather than "phone credentials are unavailable on tvOS." Consider returning a distinct unsupported-platform error from this branch so the caller-side message is honest.
- firebase_auth: verifyPhoneNumberApp / updatePhoneNumberApp now return an `unsupported-platform` FlutterError on tvOS instead of `completion(nil, nil)`, which threw an opaque `null-error` on the non-nullable Pigeon return type. - Commit the leaf packages' `pubspec_overrides.yaml` (previously gitignored) so `flutter pub get` / `dart pub publish --dry-run` resolve `firebase_core_tvos` before it is published; add `.pubignore` so they stay out of the published archive. - Remove `false_secrets` from all pubspecs — the example configs are now placeholder values, not real keys. - Docs: note in the firebase_auth README that only anonymous sign-in is runtime-verified end-to-end; note in the firebase_messaging README that onMessage / onMessageOpenedApp / getInitialMessage never emit on tvOS.
MAUstaoglu
commented
Jul 2, 2026
Addressed in
The milder credential branch is left graceful ( |
DenisovAV
commented
Jul 3, 2026
Thanks for the fast turnaround — went through
One small follow-up on the credential branch ( The minor items (dead That covers all the review findings — the credential-branch tweak is the only optional item left. Nice work on the port. |
MAUstaoglu
commented
Jul 3, 2026
Thanks for the re-review. Rolling the credential-branch tweak into the follow-up with the other minor items (dead |
DenisovAV
commented
Jul 3, 2026
Good catch — you're right, and it's a bigger change than my "same 4-line shape" made it sound. I re-checked the call sites ( And nice spot on the missing Batching it with the dead locals / podspec pins / placeholder tests makes sense. Nothing else outstanding from my side. |
Summary
Adds federated
*_tvosimplementations bringing Firebase to Apple TV via theflutter-tvos toolchain, built on the Firebase Apple SDK (which has supported
tvOS since 8.9.0). This closes the gap where the FlutterFire packages declare
ios/macosbut nottvos, even though the underlying native SDK runs on tvOS.firebase_core_tvoscloud_firestore_tvosfirebase_storage_tvosfirebase_auth_tvosunsupported-platform.firebase_messaging_tvosonMessage) and tapped-notification/interaction APIs are unavailable on tvOS.Each package re-exports the upstream Dart API and ships the native tvOS
pluginClass; the four leaf packages depend onfirebase_core_tvos.Runtime verification
Verified against a live Firebase project on both the tvOS simulator (JIT) and
a physical Apple TV (tvOS 26.5, AOT/profile):
firebase_core—initializeAppsucceedsfirebase_auth— anonymous sign-in returns a real usercloud_firestore— document write + read-back round-tripfirebase_storage— executes; returns a normal Storage error when no bucket is provisionedfirebase_messaging— executes; returnsapns-token-not-set(APNs needs a push-enabled profile)Platform.operatingSystem == "tvos"andPlatform.isIOS == trueconfirmed under AOT.Two issues that only surfaced at runtime were fixed:
firebase_auth_tvosaborted at plugin registration because the generated Pigeonsetup asserts every multi-factor selector exists; the tvOS-disabled methods are
now kept as
unsupported-platformstubs rather than removed.firebase_auth_tvos+firebase_messaging_tvosin the same app failed to compile(
-[FIRAuth canHandleNotification:], unavailable on tvOS); now guarded.Notes
Each package includes a
PORTING_REPORT.mddocumenting exactly which native APIswere adapted or disabled and why. These are
0.0.1initial releases; the intendedpublish order is
firebase_core_tvosfirst, then the four leaf packages.