패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.0.0

notification_listener_service

모든 들어오는 알림(게시 또는 제거)을 듣고 응답할 수 있는 Flutter 플러그인

Android
30일 다운로드
3.7천
좋아요
72
Pub 점수
160

패키지 설치

flutter pub add notification_listener_service

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Android용 Flutter 플러그인으로 앱이 들어오는 알림(게시 및 제거 포함)을 수신할 수 있도록 합니다. 앱에서 직접 알림에 응답할 수 있어 메시징 또는 자동화 도구에 적합합니다. 이 플러그인은 Android의 NotificationListenerService API를 활용하여 시스템 알림을 실시간으로 모니터링합니다. 개발자는 제목, 텍스트, 패키지 이름, 타임스탬프와 같은 알림 세부 정보에 접근할 수 있습니다. 사용자 권한을 통해 리스너 서비스를 활성화해야 하므로 개인정보 보호와 보안을 보장합니다. Android 전용으로 설계되어 기존 Flutter 프로젝트에 원활하게 통합됩니다.

사용 사례

  • 실시간 알림 모니터링
  • 자동 메시지 응답
  • 알림 기반 워크플로
  • 시스템 알림과 앱 통합
  • 개인정보 인식 알림 추적

주요 기능

  • 모든 수신 및 제거된 알림을 듣는다
  • 직접 응답 기능을 지원합니다
  • 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

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트