So I'm in this situation where I have to detect a click on the notification and read its metadata using AccessibilityService
. For this I'm currently using AccessibilityEvent.TYPE_VIEW_CLICKED
but it doesn't seem to work. It is not able to capture the click on the notification.
Also I tried using typeNotificationStateChanged
and NotificationListenerService
but to no avail as both these don't have methods or functions to detect a click on the notification (I'm not sure though).
Will be glad if anybody could help me out.
Note - The notifications belong to other apps and not built by my app.
What I want -
-> Detect a click on notification and extract details like title, message etc.
What I don't want -
-> Detect an incoming notification
Any help would be appreciated.
Thank you.