platform_local_notifications
4.0.0, released 2 weeks ago by vchatsdk.com
Cross-platform local notifications plugin supporting Android, iOS, Web, Windows, macOS, and Linux.
What it does
Provides a unified facade for managing and showing local notifications and chat-style messages with interactive actions across multiple operating systems. It handles platform initialization, payload delivery, notification cancellation, and user action streams.
AI-written summary of version 4.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to display standard local notifications or chat-style notifications across Android, iOS, Web, Windows, macOS, and Linux.
- Your app needs to handle click events, reply actions, or mark-as-read actions via a unified stream.
- You want to target both JavaScript and WebAssembly on web browsers using the native Browser Notifications API.
Skip it when
- You require server-driven push notifications or background messaging handlers that persist reliably after app termination without custom native setup.
- You are targeting mobile web browsers requiring service-worker notifications (such as iOS browsers).
Strengths
- Comprehensive cross-platform support including mobile, desktop, and web.
- Includes built-in chat-style notifications and interactive actions on Android with standard fallbacks on other platforms.
- Provides a unified stream API for actions like clicks, replies, and mark-as-read.
Weaknesses
- Does not persist or replay actions after app termination without custom native configuration.
- Web backend is page-scoped and requires the page to stay open to receive clicks.
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 5
Requires platform-specific configuration such as adding an action broadcast receiver in the Android manifest, setting notification center delegates on iOS and macOS, and ensuring proper desktop server/identity setup on Windows and Linux.
import 'package:flutter/widgets.dart';
import 'package:platform_local_notifications/platform_local_notifications.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await PlatformNotifier.initialize(appName: 'My App');
}
Future<void> showStandard() => PlatformNotifier.showNotification(
model: const NotificationModel(
id: 43,
title: 'Reminder',
body: 'Your meeting starts soon.',
payload: 'meeting-43',
),
);Alternatives
Packages that do the same job and could replace platform_local_notifications.
- flutter_local_notifications_linux
Linux implementation of the flutter_local_notifications plugin.
81Compare - flutter_local_notifications_platform_interface
A common platform interface for the flutter_local_notifications plugin.
88Compare - firebase_in_app_messaging
Flutter plugin for Firebase In-App Messaging campaigns.
93Compare - local_notifier
A plugin for displaying local notifications in Flutter desktop apps.
50Compare
Works with
Packages commonly used together with platform_local_notifications: ones it builds on, ones built on it, and its own family.
- uuidplatform_local_notifications depends on itGenerates and parses RFC‑4122/9562 UUIDs (v1‑v8) for Dart.
- webplatform_local_notifications depends on itLightweight bindings for browser APIs via JS interop
- flutter_cache_managerplatform_local_notifications depends on itGeneric cache manager for saving web files and cache info on device storage.
- flutter_local_notificationsplatform_local_notifications depends on itCross-platform plugin for displaying and scheduling local notifications.