firebase_messaging_tvos
The tvOS (Apple TV) implementation of firebase_messaging,
provided by the flutter-tvos toolchain.
Generated by
flutter-tvos plugin portfromfirebase_messaging, then completed by hand. SeePORTING_REPORT.mdfor the full list of what was changed and disabled.
Usage
This is a federated plugin implementation. An app that already depends on
firebase_messaging and targets Apple TV only needs to add this package
alongside it:
dependencies:
firebase_messaging: ^16.4.1
firebase_messaging_tvos: ^0.0.2
The native plugin registers automatically through flutter-tvos' plugin registrant — no extra imports or setup in app code.
tvOS support
Important: tvOS has a deliberately limited notification model. The Firebase Apple SDK and Apple's
UserNotificationsframework expose push registration (token, permission, topic subscription) on tvOS, but not the rich-content and interaction APIs apps usually build UI around —UNNotificationContent.userInfois itself unavailable on tvOS. Plan your Apple TV messaging UX accordingly.
| Capability | tvOS | Notes |
|---|---|---|
getToken / deleteToken / onTokenRefresh |
✅ | FCM registration token |
getAPNSToken |
✅ | |
requestPermission / authorization status |
✅ | Only authorizationStatus is meaningful; other settings report "unsupported" |
subscribeToTopic / unsubscribeFromTopic |
✅ | |
setAutoInitEnabled |
✅ | |
| Foreground presentation control (banner/badge/sound options) | ✅ | The delegate fires; you can still set presentation options |
onMessage (foreground payload) |
❌ | Reading the FCM payload (UNNotificationContent.userInfo) is unavailable on tvOS |
onMessageOpenedApp / getInitialMessage (tapped notification) |
❌ | tvOS has no interactive notification-response model |
| Notification settings introspection (alert/badge/sound/critical/preview/etc.) | ❌ | API_UNAVAILABLE(tvos) in the SDK; reported as "unsupported" sentinels |
Push messages are still delivered to a registered Apple TV; what's constrained is reading their payload and reacting to user interaction from Dart.
The
onMessage,onMessageOpenedApp, andonBackgroundMessagestreams never emit on tvOS, andgetInitialMessage()always resolves tonull— the underlyingUNNotificationContent.userInfoand interaction callbacks are unavailable on tvOS. These calls do not throw or hang (completions fire normally); they simply produce no events. Don't build required app logic on them for Apple TV. Token retrieval, topic subscription, and permission requests work as usual.
See PORTING_REPORT.md for the exact per-API behaviour and the open
verification questions.
Requirements
- Apple TV running tvOS 15.0 or later (the Firebase Apple SDK's minimum).
- A push-enabled provisioning profile and APNs setup, as for any FCM app.
firebase_core_tvos(pulled in automatically).
Swift Package Manager
This package ships a tvos/Package.swift. flutter-tvos links a plugin that
ships tvos/Package.swift through Swift Package Manager and leaves it out of
the Podfile. No manual setup is needed. It depends on firebase_core_tvos
0.0.4, which ships one too, and takes firebase-ios-sdk ~> 12.15.0, as in the
podspec.
Needs flutter-tvos 1.3.0 or later, the first release that links plugins through
SwiftPM, places them side by side (so ../firebase_core_tvos and
../FlutterFramework resolve) and leaves them out of the Podfile.
License
fluttertv, under a BSD-3-Clause license. See LICENSE for the full text.