firebase_messaging_devtool 0.2.1
firebase_messaging_devtool: ^0.2.1 copied to clipboard
A Flutter DevTools extension that displays Firebase Cloud Messaging (FCM) events in real-time for debugging
Firebase Messaging DevTool #
A Flutter DevTools extension for inspecting Firebase Cloud Messaging (FCM) messages in real-time.
Features #
- Real-time display of incoming FCM messages
- Detailed message inspection with notification, data, and metadata sections
- Message persistence across app reloads
- Automatic device identification for debugging multiple devices
- Option to hide null values in messages
- Auto-clear messages on reload option
Installation #
- Add the package to your
pubspec.yaml
:
dependencies:
firebase_messaging_devtool: ^0.2.1
- Install the DevTools extension:
flutter pub global activate firebase_messaging_devtool_extension_web
- Run your app:
flutter run
Usage #
- Start your Flutter app with the DevTools extension enabled
- Open the DevTools extension in your browser
- Send FCM messages to your app
- View the messages in real-time in the DevTools extension
Device Identification #
The extension automatically detects and displays device information:
- Android devices: Shows the device model and unique ID
- iOS devices: Shows the device machine name and vendor ID
- Web browsers: Shows the browser name and platform
- Desktop platforms: Shows appropriate system information
The device identification makes it easier to debug applications across multiple devices simultaneously.
Settings #
The extension provides several settings to customize your experience:
- Show newest messages on top: Toggle to change the order of messages
- Auto-clear messages on reload: Enable to automatically clear messages when the app reloads
- Clear all messages: Manually clear all stored messages
All settings are persisted between sessions for a better user experience.
Example #
A complete example application is included in the example
directory of this package. The example demonstrates:
- Setting up Firebase Messaging with proper configuration
- Implementing the DevTools integration
- Displaying the FCM token for testing
- Handling incoming messages
Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
License #
This project is licensed under the MIT License - see the LICENSE file for details.
Screenshots #
| [Firebase Messaging DevTool Extension Screenshot] | [settings] |
Setup #
-
Add Dependency: Add this package as a
dev_dependency
in your application'spubspec.yaml
:dev_dependencies: firebase_messaging_devtool: ^0.0.1 # ... other dev_dependencies
-
Enable the Extension: Add the extension configuration to your
pubspec.yaml
:# Add this at the top level, not nested under dependencies devtools: extensions: - firebase_messaging_devtool
-
Run
flutter pub get