{"id":13553021,"url":"https://github.com/DevsOnFlutter/reflex","last_synced_at":"2025-04-03T04:31:52.325Z","repository":{"id":43986854,"uuid":"439183666","full_name":"DevsOnFlutter/reflex","owner":"DevsOnFlutter","description":"Flutter plugin to read notifications and auto reply with custom messages","archived":false,"fork":false,"pushed_at":"2022-02-13T02:39:39.000Z","size":138,"stargazers_count":20,"open_issues_count":3,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-04T00:32:47.762Z","etag":null,"topics":["android","auto-reply","flutter","notifications","plugin"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/reflex","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevsOnFlutter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-17T02:11:58.000Z","updated_at":"2024-06-25T23:22:12.000Z","dependencies_parsed_at":"2022-09-08T09:20:23.278Z","dependency_job_id":null,"html_url":"https://github.com/DevsOnFlutter/reflex","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevsOnFlutter%2Freflex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevsOnFlutter%2Freflex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevsOnFlutter%2Freflex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevsOnFlutter%2Freflex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevsOnFlutter","download_url":"https://codeload.github.com/DevsOnFlutter/reflex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246939195,"owners_count":20857916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","auto-reply","flutter","notifications","plugin"],"created_at":"2024-08-01T12:02:15.772Z","updated_at":"2025-04-03T04:31:47.316Z","avatar_url":"https://github.com/DevsOnFlutter.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# Reflex\n\nFlutter plugin for notification read \u0026 reply.\n\n\u003cimg src=\"https://i.imgur.com/Y8kadag.png\" title=\"Flutter_Shortcuts\"/\u003e\n\n![GitHub](https://img.shields.io/github/license/DevsOnFlutter/reflex?style=plastic) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/DevsOnFlutter/reflex?style=plastic) ![GitHub top language](https://img.shields.io/github/languages/top/DevsOnFlutter/reflex?style=plastic) ![GitHub language count](https://img.shields.io/github/languages/count/DevsOnFlutter/reflex?style=plastic) ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/DevsOnFlutter/reflex?style=plastic) ![GitHub issues](https://img.shields.io/github/issues/DevsOnFlutter/reflex?style=plastic) ![GitHub Repo stars](https://img.shields.io/github/stars/DevsOnFlutter/reflex?style=social) ![GitHub forks](https://img.shields.io/github/forks/DevsOnFlutter/reflex?style=social)\n\n## Compatibility\n\n✅ \u0026nbsp; Android \u003c/br\u003e\n❌ \u0026nbsp; iOS (active issue: [iOS support for reflex](https://github.com/DevsOnFlutter/reflex/issues/1))\n\n## Show some :heart: and :star: the repo\n\n## Why use Reflex?\n\nReflex Plugin is known for:\n\n| Reflex |\n| :--------------------------------- |\n| Fast, performant \u0026 compatible |\n| Free \u0026 Open-source |\n| Production ready |\n| Make App Reactive |\n\n## Features\n\nAll the features listed below can be performed at the runtime.\n\n✅ \u0026nbsp; Get Notification Stream \u003c/br\u003e\n✅ \u0026nbsp; Read Notification \u003c/br\u003e\n✅ \u0026nbsp; Reply From Notification \u003c/br\u003e\n✅ \u0026nbsp; Auto Reply \u003c/br\u003e\n\n## Demo\n\n|\u003cimg height=500 src=\"https://i.imgur.com/pG2qr2J.gif\"/\u003e|\n|---|\n\n## Quick Start\n\n### Step 1: Include plugin to your project\n\n```yml\ndependencies:\n  reflex: \u003clatest version\u003e\n```\n\nRun `pub get` and get packages.\n\n### Step 2: Add Service in `AndroidManifest.xml`\n\nAdd the following service inside the `application` tag of `AndroidManifest.xml`.\n\n```xml\n    ...\n    \u003cservice\n        android:label=\"notifications\"\n        android:name=\"com.devsonflutter.reflex.notification.NotificationListener\"\n        android:permission=\"android.permission.BIND_NOTIFICATION_LISTENER_SERVICE\"\u003e\n        \u003cintent-filter\u003e\n            \u003caction android:name=\"android.service.notification.NotificationListenerService\" /\u003e\n        \u003c/intent-filter\u003e\n    \u003c/service\u003e\n\u003c/application\u003e\n```\n\n**Android 12+ Compatibility**\nAdd `android:exported=\"true\"` field in the service tag to make it compatible with Android 12+.\n\n```xml\n    ...\n    \u003cservice\n        android:label=\"notifications\"\n        android:name=\"com.devsonflutter.reflex.notification.NotificationListener\"\n        android:permission=\"android.permission.BIND_NOTIFICATION_LISTENER_SERVICE\"\n        android:exported=\"true\"\u003e\n        \u003cintent-filter\u003e\n            \u003caction android:name=\"android.service.notification.NotificationListenerService\" /\u003e\n        \u003c/intent-filter\u003e\n    \u003c/service\u003e\n\u003c/application\u003e\n```\n\n### Step 3: Instantiate Reflex\n\nReflex must only be instantiated only once.\n\n```dart\nReflex reflex = Reflex();\n```\n\n\n## Example\n\nGo to example section in pub.dev to see the full example code.\n\nIn GitHub, head over to `example/lib/main.dart` to see the full example code.\n\n### Import\n\nThis single import is enough for using reflex.\n\n```dart\nimport 'package:reflex/reflex.dart';\n```\n\n### Listen \u0026 Reply\n\n```dart\nStreamSubscription\u003cReflexEvent\u003e? _subscription;\nfinal List\u003cReflexEvent\u003e _notificationLogs = [];\nfinal List\u003cReflexEvent\u003e _autoReplyLogs = [];\nbool isListening = false;\n\nReflex reflex = Reflex(\n  debug: true,\n  packageNameList: [\"com.whatsapp\", \"com.tyup\"],\n  packageNameExceptionList: [\"com.android.systemui\"],\n  autoReply: AutoReply(\n    packageNameList: [\"com.whatsapp\"],\n    message: \"[Reflex] This is an automated reply.\",\n  ),\n);\n\n@override\nvoid initState() {\n  super.initState();\n  initPlatformState();\n}\n\nFuture\u003cvoid\u003e initPlatformState() async {\n  startListening();\n}\n\nvoid onData(ReflexEvent event) {\n  setState(() {\n    if (event.type == ReflexEventType.notification) {\n      _notificationLogs.add(event);\n    } else if (event.type == ReflexEventType.reply) {\n      _autoReplyLogs.add(event);\n    }\n  });\n  debugPrint(event.toString());\n}\n\nvoid startListening() {\n  try {\n    _subscription = reflex.notificationStream!.listen(onData);\n    setState(() {\n      isListening = true;\n    });\n  } on ReflexException catch (exception) {\n    debugPrint(exception.toString());\n  }\n}\n\nvoid stopListening() {\n  _subscription?.cancel();\n  setState(() =\u003e isListening = false);\n}\n```\n\n## Quick Guide\n\nA quick guide to **Flutter Reflex plugin**!\n\n### Debugging\n\nDebugging allows you to debug the plugin's functionality, logs are shown in the console.\n\nBy default debug logging is enabled. You can configure it using the debug field in the Reflex class.\n\n\n```dart\nReflex reflex = Reflex(\n  debug: false,\n);\n```\n\n### Listen notification permission\n\nSee if listening notification permission has been granted or not.\n\n```dart\nbool isPermissionGranted = await Reflex.isPermissionGranted;\n```\n\n### Request notification listening permission\n\nUse the function to grant notification listening permission.\n\n```dart\nawait Reflex.requestPermission();\n```\n\n### Notification Stream\n\nUse the reflex object to get a notification stream to listen to notifications in your flutter application.\n\n```dart\nStreamSubscription\u003cReflexEvent\u003e? _subscription;\n_subscription = reflex.notificationStream!.listen((event) {\n  // Application Logic\n});\n```\n\nThe stream is subscribed for `ReflexEvent` whenever a notification is received.\n\n#### Reflex Event\n\nThe incoming reflex event contains:\n\n* **type**: `ReflexEventType.notification` whenever a notification is received to flutter application, and `ReflexEventType.reply` whenever an automated reply is sent.\n\n* **packageName**: Application's package name from which notifications are received and reply are sent.\n\n* **title**: Notification title\n\n* **message**: Message contained in the notification and while sending reply.\n  \n* **timestamp**: Timestamp of the notification received and reply sent.\n\n### Listen notification from specific apps\n\nSpecify list of package names to listen to notifications from those applications.\n\nIf `packageNameList: null` plugin will listen to notifications from all packages.\n\n```dart\nReflex reflex = Reflex(\n  debug: true,\n  packageNameList: [\"com.whatsapp\", \"com.facebook\"],\n);\n```\n\n### Avoid notification from specific apps\n\nSpecify package name exception list to avoid listening notifications from those applications.\n\nIf `packageNameExceptionList: null`, the plugin will listen to notifications for `packageNameList` if not null.\n\n```dart\nReflex reflex = Reflex(\n  debug: true,\n  packageNameExceptionList: [\"com.whatsapp\"],\n);\n```\n\n### Auto Reply\n\nSend an automated reply while listening notification.\n\n```dart\nAutoReply autoReply = AutoReply(\n  message: \"[Reflex] This is an automated reply.\",\n),\n```\n\n#### Auto reply specific apps\n\nSpecify `packageNameList` in AutoReply to reply to specific applications.\n\n```dart\nAutoReply autoReply = AutoReply(\n  packageNameList: [\"com.whatsapp\"],\n  message: \"[Reflex] This is an automated reply.\",\n),\n```\n\nThe `AutoReply` object is used by the Reflex's `autoReply` field to automatically reply to applications.\n\n```dart\nReflex reflex = Reflex(\n  debug: true,\n  packageNameList: [\"com.whatsapp\", \"com.tyup\"],\n  packageNameExceptionList: [\"com.miui.securitycenter\"],\n  autoReply: AutoReply(\n    packageNameList: [\"com.whatsapp\"],\n    message: \"[Reflex] This is an automated reply.\",\n  ),\n);\n```\n\nIf the `autoReply` field is `null` in `Reflex` class, Auto reply feature will be disabled.\n\n## Ambiguity\n\nA `ReflexException` will be thrown if,\n\n* `Reflex`'s `packageNameList` and `packageNameExceptionList` contains any similar package name.\n\n* any package name in `AutoReply`'s `packageNameList` is contained in `Reflex`'s `packageNameExceptionList`.\n\n## Project Created \u0026 Maintained By\n\n### Divyanshu Shekhar\n\n\u003ca href=\"https://twitter.com/dshekhar17\"\u003e\u003cimg src=\"https://github.com/aritraroy/social-icons/blob/master/twitter-icon.png?raw=true\" width=\"60\"\u003e\u003c/a\u003e \u003ca href=\"https://in.linkedin.com/in/dshekhar17\"\u003e\u003cimg src=\"https://github.com/aritraroy/social-icons/blob/master/linkedin-icon.png?raw=true\" width=\"60\"\u003e\u003c/a\u003e \u003ca href=\"https://instagram.com/dshekhar17\"\u003e\u003cimg src=\"https://github.com/aritraroy/social-icons/blob/master/instagram-icon.png?raw=true\" width=\"60\"\u003e\u003c/a\u003e\n\n[![GitHub followers](https://img.shields.io/github/followers/divshekhar.svg?style=social\u0026label=Follow)](https://github.com/divshekhar/)\n\n### Subham Praharaj\n\n\u003ca href=\"https://twitter.com/SubhamPraharaj6\"\u003e\u003cimg src=\"https://github.com/aritraroy/social-icons/blob/master/twitter-icon.png?raw=true\" width=\"60\"\u003e\u003c/a\u003e \u003ca href=\"https://www.linkedin.com/in/subham-praharaj-66b172179/\"\u003e\u003cimg src=\"https://github.com/aritraroy/social-icons/blob/master/linkedin-icon.png?raw=true\" width=\"60\"\u003e\u003c/a\u003e \u003ca href=\"https://instagram.com/the_champ_subham_865\"\u003e\u003cimg src=\"https://github.com/aritraroy/social-icons/blob/master/instagram-icon.png?raw=true\" width=\"60\"\u003e\u003c/a\u003e\n\n[![GitHub followers](https://img.shields.io/github/followers/skpraharaj.svg?style=social\u0026label=Follow)](https://github.com/skpraharaj/)\n\n## Contributions\n\nContributions are welcomed!\n\n**If you feel that a hook is missing, feel free to open a pull-request.**\n\nFor a custom-hook to be merged, you will need to do the following:\n\n* Describe the use-case.\n\n* Open an issue explaining why we need this hook, how to use it, ...\n  This is important as a hook will not get merged if the hook doens't appeal to\n  a large number of people.\n\n* If your hook is rejected, don't worry! A rejection doesn't mean that it won't\n  be merged later in the future if more people shows an interest in it.\n  In the mean-time, feel free to publish your hook as a package on [https://pub.dev](https://pub.dev).\n\n* A hook will not be merged unles fully tested, to avoid breaking it inadvertendly in the future.\n  \n## Stargazers\n\n[![Stargazers repo roster for @DevsOnFlutter/reflex](https://reporoster.com/stars/dark/DevsOnFlutter/reflex)](https://github.com/DevsOnFlutter/reflex/stargazers)\n\n## Forkers\n\n[![Forkers repo roster for @DevsOnFlutter/reflex](https://reporoster.com/forks/dark/DevsOnFlutter/reflex)](https://github.com/DevsOnFlutter/reflex/network/members)\n\n## Copyright \u0026 License\n\nCode and documentation Copyright (c) 2021 [Divyanshu Shekhar](https://hackthedeveloper.com). Code released under the [BSD 3-Clause License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDevsOnFlutter%2Freflex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDevsOnFlutter%2Freflex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDevsOnFlutter%2Freflex/lists"}