fcm_actions
1.0.3, released 5 weeks ago by an unverified publisher
Production-ready FCM actions, tokens, topics, and routing for Flutter apps.
What it does
Normalizes Firebase Cloud Messaging payloads, manages tokens and topics, handles action buttons, inline replies, and background tasks, and provides typed event streams and route mapping.
AI-written summary of version 1.0.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need robust action buttons, inline replies, and deep linking for Firebase Cloud Messaging.
- You want centralized routing and middleware for notification events across multiple platforms.
Skip it when
- You only require basic local notifications without Firebase Cloud Messaging.
- You are using a push provider other than FCM.
Strengths
- Handles complex notification flows including background actions and inline replies out of the box.
- Supports Android, iOS, macOS, and web with WASM compatibility.
- Includes built-in replay protection, payload size limits, and persistent retries.
Weaknesses
- Requires native configuration steps such as APNs entitlements on iOS and Java desugaring on Android.
- Topics are not supported on the web platform.
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 9
Requires running flutterfire configure, enabling Push Notifications and Background Modes in Xcode for iOS, and adding core-library desugaring dependencies for Android.
final result = await FcmActions.initialize(
navigatorKey: navigatorKey,
actions: const [
NotificationAction(id: 'accept', title: 'Accept'),
NotificationAction(id: 'decline', title: 'Decline', destructive: true),
],
routes: const [
RouteMapper(type: 'chat', route: '/chat'),
],
onAction: (event, data) async {
debugPrint('${event.actionId}: $data');
},
);Alternatives
Packages that do the same job and could replace fcm_actions.
- onesignal_flutter
If you prefer using OneSignal instead of Firebase Cloud Messaging for push notifications.
82Compare
Works with
Packages commonly used together with fcm_actions: ones it builds on, ones built on it, and its own family.
- cryptofcm_actions depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- json_annotationfcm_actions depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- shared_preferencesfcm_actions depends on itFlutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
- firebase_corefcm_actions depends on itFlutter plugin that initializes Firebase and allows multiple Firebase app connections.
- freezed_annotationfcm_actions depends on itAnnotations for the freezed code-generator.
- firebase_messagingfcm_actions depends on itFlutter plugin for Firebase Cloud Messaging to deliver messages on Android, iOS, web, and macOS.
- flutter_local_notificationsfcm_actions depends on itCross-platform plugin for displaying and scheduling local notifications.