パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.0.0

notification_listener_service

すべての受信通知(投稿または削除)をリッスンするためのFlutterプラグインで、それらに返信する可能性も提供

Android
30日間ダウンロード
3650
いいね数
72
Pub ポイント
160

パッケージをインストール

flutter pub add notification_listener_service

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Android用のFlutterプラグインで、アプリが着信通知(投稿および削除を含む)をリッスンできるようにします。アプリから直接通知に返信できるため、メッセージングやオートメーションツールに最適です。このプラグインは、AndroidのNotificationListenerService APIを利用して、システム通知をリアルタイムで監視します。開発者はタイトル、本文、パッケージ名、タイムスタンプなどの通知の詳細にアクセスできます。リスナーサービスを有効にするためにユーザーの許可が必要であり、プライバシーとセキュリティを確保しています。Android専用に設計されており、既存のFlutterプロジェクトにスムーズに統合できます。

用途

  • リアルタイム通知モニタリング
  • 自動メッセージ返信
  • 通知ベースのワークフロー
  • アプリのシステム通知との統合
  • プライバシー意識的な通知トラッキング

主な機能

  • すべての受信および削除された通知をリッスンする
  • 直接返信機能をサポートしています
  • Android専用プラットフォーム互換性
  • 権限ベースのセキュアなアクセス
  • 詳細な通知メタデータを提供します

適している対象

  • 通知自動化ツールを開発する開発者
  • リアルタイム通知インサイトを必要とするアプリ
  • メッセージングまたはチャットアプリケーション
  • システムレベルのAndroid統合
  • プライバシー重視の通知ハンドラー

注意事項

  • Android専用の設定と権限が必要です
  • ユーザーはリスナー サービスを手動で有効にする必要があります
  • Androidプラットフォームに限定
  • 継続的なリスニングによりバッテリー寿命に影響する可能性があります
  • 機密データへのアクセスには注意が必要です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

notification_listener_service

A flutter plugin for interacting with Notification Service in Android.

NotificationListenerService is a service that receives calls from the system when new notifications are posted or removed,

for more info check NotificationListenerService

Installation and usage

Add package to your pubspec:

dependencies:
  notification_listener_service: any # or the latest version on Pub

Inside AndroidManifest add this to bind notification service with your application


<service android:label="notifications" android:name="notification.listener.service.NotificationListener"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" android:exported="true">
        <intent-filter>
            <action android:name="android.service.notification.NotificationListenerService" />
        </intent-filter>
    </service>


USAGE
 /// check if notification permession is enebaled
 final bool status = await NotificationListenerService.isPermissionGranted();

 /// request notification permission
 /// it will open the notifications settings page and return `true` once the permission granted.
 final bool status = await NotificationListenerService.requestPermission();

 /// stream the incoming notification events
  NotificationListenerService.notificationsStream.listen((event) {
    log("Current notification: $event");
  });

The ServiceNotificationEvent provides:

  /// the notification id
  int? id;

  /// check if we can reply the Notification
  bool? canReply;

  /// if the notification has an extras image
  bool? haveExtraPicture;

  /// if the notification has been removed
  bool? hasRemoved;

  /// notification extras image
  /// To display an image simply use the [Image.memory] widget.
  Uint8List? extrasPicture;

  /// notification large icon
  /// To display an image simply use the [Image.memory] widget.
  Uint8List? largeIcon;

  /// notification package name
  String? packageName;

  /// notification title
  String? title;

  /// the notification app icon
  /// To display an image simply use the [Image.memory] widget.
  Uint8List? appIcon;

  /// the content of the notification
  String? content;

  /// send a direct message reply to the incoming notification
  Future<bool> sendReply(String message)

To reply to a notification provides:

  try {
    await event.sendReply("This is an auto response");
  } catch (e) {
    log(e.toString());
  }

Example of the app on foreground

Find the exemple app Here

Screenshots

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト