notification_history 1.0.1 copy "notification_history: ^1.0.1" to clipboard
notification_history: ^1.0.1 copied to clipboard

A Flutter package to manage and display the history of notifications received by the app, including Firebase Cloud Messaging (FCM) notifications.This package provides a local database to store notific [...]

Notification History #

A Flutter package for managing and displaying push notification history using Firebase Cloud Messaging (FCM) and local notifications.

Features #

Store notifications in a local SQLite database. Display notification history with read/unread status. Support for FCM and local notifications. Clean architecture with dependency injection using get_it.

Installation #

  1. Add the package to your pubspec.yaml: dependencies: notification_history: path: /path/to/notification_history # For local development

    Or use: git: https://github.com/yourusername/notification_history.git #

    Or use: version: ^1.0.0 (after publishing to pub.dev) #

  2. Run flutter pub get. Setup

  3. Configure Firebase:

Add google-services.json to android/app/ and GoogleService-Info.plist to ios/Runner/. Initialize Firebase in your app:await Firebase.initializeApp();

  1. Set Up Dependency Injection: import 'package:get_it/get_it.dart'; import 'package:notification_history/notification_history.dart';

final getIt = GetIt.instance;

void setupDI() { getIt.registerSingleton

  1. Initialize Notifications: void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); setupDI(); await getIt

  2. Display Notification History: Navigator.push( context, MaterialPageRoute( builder: (context) => NotificationHistoryScreen( getNotifications: getIt

  3. Show a Local Notification: getIt

  4. Android Configuration

Add to android/app/src/main/AndroidManifest.xml:<application ...>

Add to android/app/src/main/res/values/strings.xml:

  1. iOS Configuration

Enable Push Notifications in Xcode. Add GoogleService-Info.plist to ios/Runner/.

Example #

See the example/ directory for a sample app.

License #

MIT License

2
likes
0
points
26
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package to manage and display the history of notifications received by the app, including Firebase Cloud Messaging (FCM) notifications.This package provides a local database to store notifications and a UI to display them, making it easy.

Repository
View/report issues

License

unknown (license)

Dependencies

cupertino_icons, firebase_core, firebase_messaging, flutter, flutter_local_notifications, get_it, path, sqflite

More

Packages that depend on notification_history