STEP 1 - INTERCEPT NOTIFICATION FOR APP
This will trigger the profile everytime there's a new notification, in contrast to the AutoNotification Intercept state which will make the profile remain active as long as the notification is present
- Open Tasker and create a new profile
- Use the AutoNotification Intercept event condition.
STEP 2 - CONFIGURE CONDITION
I'm using AutoRemote because it has an easy way to create notifications so I can easily test this profile. You can intercept notifications from any app.
- Make it only intercept created notifications
- Set it to intercept notifications from AutoRemote only
- Accept these settings and create a task that reacts to this event
STEP 3 - SHOW THAT YOU RECEIVED THE NOTIFICATION
%anbutton1action contains a special ID that represents the action for the intercepted notification's first button which is the button on the left of notifications. This can be used to simulate the button action as you can see next
- Add a flash action with the text "Got autoremote notification %anbutton1action"
STEP 4 - PRESS THE BUTTON
You could use any notification action here including %antouchaction for example which would simulate touching the notification itself. You can find all the notification action variables here.
- Add an AutoNotification Actions Tasker action
- In the Intercept Action ID field insert the %anbutton1action variable
Here are how the notification actions are laid out:
- Back out of Tasker to save
STEP 5 - TEST IT
To test it you can send yourself an AutoRemote notification with a button that flashes the words "Button 1 Pressed"
When you receive the notification you should see the first flash saying that you got the notification along with the action ID.
Then you should see a flash with "Button 1 Pressed" which comes from AutoNotification simulating the button press on the AutoRemote notification
If you don't have AutoRemote or don't know how to create the notification mentioned above, create a notification with the native Tasker Notify action that does any action you want and test it with that. Make sure to have the "Intercept Tasker Notifications" option checked in the main AutoNotification app though!
Press a button on a notification as soon as you receive it
Will emulate you pressing a notification button as soon as the notification is created