Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we perform an ACTION programmatically on a Notification from Notification Listener Service?

Is it possible to invoke an ACTION programatically on a Notification from a NotificationListenerService? I have written a Notification Listener service that reads out all the incoming notifications and dismisses when done. But I'm not sure if we can perform any ACTIONs on the incoming notifications.

For eg: On a WhatsApp message notification I can read the package name, sender and message details but is there a way to send a reply back to the sender? Currently Android Wear is doing this so I'm wondering if it is following a generic approach of acting upon a Notification or it has a specific API to WhatsApp service.

like image 792
AndroidDev Avatar asked Oct 20 '22 23:10

AndroidDev


1 Answers

When ever a whatsapp notification is received via notification listerner service there is one another notification thats received (hidden) which has a tag value something like this [email protected] (xxxxxxx being the phonenumber), I think this somehow holds the key to sending a reply to this user.

I am working on other app logic, which does not require you to send back replies but I found this interesting but could not get enough time to check it myself.

like image 100
Rashmit Avatar answered Oct 30 '22 02:10

Rashmit