firebase_messaging_tvos

The tvOS (Apple TV) implementation of firebase_messaging, provided by the flutter-tvos toolchain.

Generated by flutter-tvos plugin port from firebase_messaging, then completed by hand. See PORTING_REPORT.md for 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.1

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 UserNotifications framework expose push registration (token, permission, topic subscription) on tvOS, but not the rich-content and interaction APIs apps usually build UI around — UNNotificationContent.userInfo is 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, and onBackgroundMessage streams never emit on tvOS, and getInitialMessage() always resolves to null — the underlying UNNotificationContent.userInfo and 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).

License

fluttertv, under a BSD-3-Clause license. See LICENSE for the full text.