flutter_notification_listener_service 0.0.6

SDKflutter
Platformandroid

This package enables Flutter developers to listen for notifications on android in their applications

flutter_notification_listener_service

Introduction

The flutter_notification_listener_service package enables Flutter developers to listen for notifications in their applications. This functionality is inspired by existing Flutter plugins and aims to provide a straightforward method for listening to notifications.

Features

  • Check permission status for accessing notifications.
  • Start and stop notification listener services programmatically.
  • Stream and handle notifications directly from the native platform.

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_notification_listener_service: latest_version

Android Setup

To use flutter_notification_listener_service on Android, you need to declare the notification listener service in your AndroidManifest.xml. This setup is required to allow your app to access notification data. Add the following service declaration inside the <application> tag of your AndroidManifest.xml file:

<service
    android:name="com.adora.flutter_notification_listener_service.NotificationsHandlerService"
    android:label="Adora Flutter Notification Listener Service"
    android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"
    android:exported="true">
    <intent-filter>
        <action android:name="android.service.notification.NotificationListenerService" />
    </intent-filter>
</service>

For dart side implementation, refer to the example code.

Acknowledgments

This package was inspired by the functionalities provided by flutter_accessibility_service and flutter_notification_listener.

Contributing

Contributions are welcome! Please feel free to start discussions and open PRs.

License

This project is licensed under the BSD 3-Clause License