Notification filter

Post your questions and help other users.

Moderator: Martin

Post Reply
dribnus
Posts: 9
Joined: 04 Jun 2018 15:36

Notification filter

Post by dribnus » 24 Jun 2018 23:26

I'm learning how all this works, but haven't figured this out yet. I have an app that lets me know when certain apps have a notification for me. This apps collects from these different apps so I have one notification. This app does not have an audio notification though, just status bar icon. I'm trying to get AM to not only give me an audio alert, which I have figured that out, but to NOT give the alert if the notification is still visible. I will only get the audio alert for new message if the notification is cleared from the status bar. I've tried using "condition" but the status bar icon is already there once the flow is executed.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Notification filter

Post by Desmanto » 25 Jun 2018 17:34

Sorry, but I repharse your case first, to make sure we are on the same page :

1. You have app XYZ.
2. XYZ create notif but no sound.
3. You use Automagic, create notif with sound. At the same time, remove App XYZ notif, so only Automagic's notif remains
4. New notif from XYZ, clear the notif, but don't give any sound anymore in Automagic notif.

If so, you just have to clear the XYZ notif everytime it arrives and replace it with automagic's version of notif, IF Automagic's notif is not there yet.
Trigger : Notification on Statusbar Displayed : XYZ
Action 1 : Remove Notification on Statusbar : from XYZ
Condition 1 : Notification on Statusbar Displayed : From Automagic
Action 2 : False, Notification on Statusbar Displayed, create the Automagic's version notif that has sound.

First event, XYZ create notif. Immediately remove by automagic and replace with automagic's notif with sound.
Second event, XYZ create notif again, but this time Automagic's notif already there, so do nothing.
If Automagic's notif is cleared, then no notif yet, first event will happen again.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

dribnus
Posts: 9
Joined: 04 Jun 2018 15:36

Re: Notification filter

Post by dribnus » 25 Jun 2018 18:02

Desmanto wrote:Sorry, but I repharse your case first, to make sure we are on the same page :

1. You have app XYZ.
2. XYZ create notif but no sound.
3. You use Automagic, create notif with sound. At the same time, remove App XYZ notif, so only Automagic's notif remains I am not using the AM notifications, just the XYZ App notification icon, which only can be removed when I clear it.
4. New notif from XYZ, clear the notif, but don't give any sound anymore in Automagic notif. Until I clear the XYZ notif, I don't want to receive the audio alert

If so, you just have to clear the XYZ notif everytime it arrives and replace it with automagic's version of notif, IF Automagic's notif is not there yet.
Trigger : Notification on Statusbar Displayed : XYZ
Action 1 : Remove Notification on Statusbar : from XYZ
Condition 1 : Notification on Statusbar Displayed : From Automagic
Action 2 : False, Notification on Statusbar Displayed, create the Automagic's version notif that has sound.

First event, XYZ create notif. Immediately remove by automagic and replace with automagic's notif with sound. I can see how this would work, but haven't figured out how to make AM clear XYZ notif.
Second event, XYZ create notif again, but this time Automagic's notif already there, so do nothing.
If Automagic's notif is cleared, then no notif yet, first event will happen again.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Notification filter

Post by Desmanto » 26 Jun 2018 15:49

You don't want to create a new notif, that means you can replace the Automagic's notif action with action sound (just to create sound). But that won't work, the event happen so fast, that we can't be sure which trigger happen first.

Most app, when they have new stacked notification, the app will remove the previous notif and create a new notif. Example
1st notif : XYZ create new notif
2nd notif : XYZ remove previous notif, create new notif
3rd notif : XYZ remove previous notif, create new notif

So if we use only trigger Notification on Statusbar Displayed, and then checked this notif existence after it, using condition, it will always result in true (since it is almost impossible we can manually remove the notif in a split second after it appears, unless we use automagic).

The problem here is, the phone sometimes will get the Notification on Statusbar Displayed first, before the Notification on Statusbar Removed. So we can't use the Removed notif trigger as the check. We have to remove all of the XYZ and replace it with automagic's notif. Thus my method above. This can't be helped, almost similar to whatsapp auto reply problem. There is a similar case too, but with timeout 5 minutes : viewtopic.php?f=5&t=7435

To be able to clear other app notif, Automagic must be granted Notification access permission. You can find it in the Automagic settings > Features & Permissions. Then in the action Remove Notification on Statusbar, choose notification type : General and Notifications from specific app : com.packagename.XYZ. The rest just follow the concept above.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply