Prevent WhatsApp from playing notification sound - android

maybe you know the problem, you're in a whatsapp group with many notifications about messages you don't care about.
To prevent turning off all notifications/sounds, how can i catch/hook the notifcation event from whatsapp, and maybe even discard a notification in the top bar ?
Thanks for any suggestions

You cannot monitor, control, override and dismiss notifications from another app in your own app.
However, in the WhatsApp specific case, you can mute the group from within the WhatsApp app, or even turn off group notifications entirely.

Related

Mute a specific notification

I am using a Notification Listener Service to receive any posted notification.
For some reason I would like to mute a notification that comes with a specific text. For example, if a Whatsapp notification is posted from a specific contact I may decide to mute that notification or to let it play as normal.
Is there any way to mute it?
I receive many emails from Office and all of them are important and I have to wake up in the night. But sometimes one is not important (the subject in the email is "not urgent") and I don't need to wake up in that case.
I know I can dismiss a notification but I want to let it display. I just want to mute the sound. Any ideas?
I Don't think you can "mute" notification from other apps. Every App works in it's own sandbox so you can't react with an "multi-maintenance-tool" to the apps.
A better Idea is to use an extended e-mail client (like K-9 Email) and check, if there are features like yours in there. Or check other e-mail clients.

Is it possible to move a notification from heads-up to the status bar?

Background
Android Lollipop (API 21) introduced a way to show notifications outside of the status bar (AKA "notifications bar"), so that the user can handle them right away. It's called "Heads-up notifications".
The trigger for showing them may vary between devices/roms/manufacturers.
The problem
Sometimes, showing such notifications can annoy users, and most of the times there are no settings for those cases.
If the user dismisses heads-up notifications, they won't show as a normal notification. There is no way to hide them and continue with what's on the screen. You can only wait (and it's quite a long time of waiting too).
In fact, there are multiple Google-Group issues that were opened about it, just because it can annoy people (link here and here).
What I've found
Starting with API 18, it is possible to listen to notifications events and even read them, by using "NotificationListenerService" and "StatusBarNotification" , and maybe other classes.
However, other than dismissing notifications (of other apps), I can't find any other action that can be done to them.
The question
Is it possible that in the lifetime of my app, I will be able to listen to notifications that are shown as heads-up, and put them back as a status-bar notifications?
Maybe even set a different timeout for them? or choose to convert them to normal status-bar notifications when they get dismissed?
Maybe before even doing those operations, I should ask: how can I know if a notification that I've found (of other apps) is showing as a heads-up notification ?
I don't know how to do implement this. But answering the "Is it possible that...?" question, yes, there are apps like this one that block/only show notifications in the notification bar.

How to make ongoing wearable notification without "Mute App" action

I am trying to make player notification with play/stop actions that is ongoing. I manage to make ongoing notification on wearable but i can't figure out how to make it without Mute app action that added automatically for ongoing notifications. TuneIn, Google Play Music and PlayerFm somehow manage to do this so there is way i just can't find it. May be anyone know how to do this?
I will answer my own question. Apparently there is no way to do this trough Notification. What all those apps do - they use RemoteControlClient to achieve this.

Knowing when the Clear button is pressed

Is it possible (i'm sure it is because i've seen other apps do it) to know when the clear notifications button is pressed without having an active notification?
For instance, I need to know if the user has an SMS notification, if he pushes clear I would like to be told. Is there a callback for this?
Is it possible (i'm sure it is because i've seen other apps do it) to know when the clear notifications button is pressed without having an active notification?
No, it is not possible.
I need to know if the user has an SMS notification
No, you do not. For starters, there are a few hundred SMS clients, many of which will use Notifications, so there is no singular "SMS notification". And, as noted, you do not have any means of determining when other applications add or remove Notifications.

Controlling SMS notifications

I have created a broadcast receiver that uses the SMS_RECEIVER. So far everything works fine with it. Now I would like to modify the notification settings for the sms e.g. adjust volume, turn on vibrate, change audio file...
Basically, I would like this app to duplicate the custom ringtone notification. So I would get the sms, check the senders phone number, and change the notification accordingly. I'm having trouble finding documentation on how to do this per text message. Could someone please link me to some documentation or a code snipet of how to do this?
(I found an example on how to silence the phone but the problem with that example is the phone will remain silenced until the code/user turns the volume back on. I would like to only perform the action on the text message being received at the time, this way it will not affect other functionality of the phone)

Categories

Resources