firebase_messaging_watchos 0.2.0
firebase_messaging_watchos: ^0.2.0 copied to clipboard
watchOS implementation of firebase_messaging, bridging the Firebase Apple SDK (FirebaseMessaging) over dart:ffi for tokens, topics, and messages.
0.2.0 #
- Breaking: works with
firebase_messaging17.x, and needs it. The package now depends onfirebase_core: ^5.0.0(was^4.0.0) andfirebase_messaging_platform_interface: ^4.11.0(was^4.9.0), the first version of the platform interface forfirebase_core5.x. An app that stays onfirebase_messaging16.x keeps 0.1.1. - The watch still links the Firebase Apple SDK 11.x through
watchos/Package.swift. The newer SDK thatfirebase_messaging17.x uses on iOS and macOS does not apply to it. register,unregister,onRegisteredandonUnregistered, the Firebase Installation ID registration thatfirebase_messaging17.0.0 adds, are not implemented on watchOS yet and throwUnimplementedError. They needFIRMessaging'sregisterWithCompletion:andunregisterWithCompletion:, which the Firebase Apple SDK has from 12.16.0, and this package links 11.x.getToken,onTokenRefreshanddeleteToken, which 17.0.0 deprecates in their favour, keep working. A new test checks the four new members.- README: the install snippet names
firebase_core: ^5.1.0,firebase_messaging: ^17.0.1and this version, and the implemented surface lists the members that are not implemented yet. - Example:
pubspec.yamlnamesfirebase_messaging: ^17.0.1andfirebase_core: ^5.1.0. Its code is unchanged and still callsgetTokenandonTokenRefresh. No native code changed, and the example was not rebuilt on the Simulator for this version.
0.1.1 #
- API docs and comments say "release" for handing native memory back.
- Example: the notification settings screen calls the message-content setting "Message Content".
- Example:
pubspec.yamlnamesfirebase_messaging: ^16.7.0instead ofany.
0.1.0 #
- Released with flutter-watchos 0.1.0. The code is the same as in the last published build.
- The watchOS implementation of
firebase_messaging: a dart:ffi bridge over the Firebase Apple SDK (FirebaseMessaging) implementing tokens (getToken,getAPNSToken,deleteToken,onTokenRefresh), permissions (requestPermission, andgetNotificationSettingsmapped to the subset ofUNNotificationSettingsthat watchOS has), messages (onMessage,onMessageOpenedApp,getInitialMessage), topics (subscribeToTopic,unsubscribeFromTopic), and presentation and auto-init settings. - Receives the APNs device token and notification payloads through the
flutter-watchosrunner'sFlutterWatchOSAppDelegate(@WKApplicationDelegateAdaptor), the only path watchOS offers for remote notifications. registerBackgroundMessageHandleris a no-op (watchOS has no background isolate);setDeliveryMetricsExportToBigQueryis Android and web only.- Scaffolded with
flutter-watchos plugin port, then finished by hand. - Links the Firebase Apple SDK through the CLI's support for external SwiftPM dependencies.
- Checked on the watchOS 27.0 Simulator: the example builds and starts, and the host unit tests pass. Not yet run on a physical Apple Watch.