Notification sounds are getting suppressed due to Xiaomi sound settings. If Allow sound is toggled off notification sound will not be played. I want to show a popup to the user if this setting is disabled, but I am not able to fetch this setting using Notification manager or Android Manager. How can I fetch this os specific setting so that I can nudge the user?
Related
I'm currently working on a chat client for Android. When I've created the channel notification (only one for all the notification, am I doing something wrong?) I've set the priority to HIGH, and the notifications works like a charm. On Xiaomi Devices, settings for notifications of specific application are pretty different from the standard one. Settings for notification of a single application are:
Show notification
Floating notification
Lock screen notification
Sound
Vibration
Notification light
So, when I create my channel following Android guidance, my notification channel is created with only 1 and 5 active, and the result is that notification is not useful on Xiaomi devices if user doesn't setup them correctly from device settings. I can accept this behaviour if it will be standard, but I've tried to install Telegram to Xiaomi device and all these settings are enabled by default.
My question is: How they achieve that? How can I enable by default all these settings when I create my channel for notifications?
I have created a notification channel and added sound attributes to it.
The issue I am facing is that I am not able to loop the notification sound until the notification has been cancelled. I am using the flag FLAG_INSISTENT, with the NotificationBuilder, which as per the documentation, does the following -
Bit set in the Notification flags field if the audio will be repeated until the notification is
cancelled or the notification window is opened.
This flag plays the sound in the loop but once notification window is opened(the notification panel is dragged down) the notification sound stops. Is there any alternative way to play the ringtone until the notification has been cancelled.
PS- I have explored other options such as MediaPlayer (which requires storage permission to play ringtone in external storage) and Ringtone object(this has the function of setLooping() which was added in API 28 and no alternative for lower SDKs)
I have a bunch of notifications for new messages (MessagingStyle, one notification contains one or more messages with the same user), and I want to play sound when a new message arrives now. Sometimes I want to update the notification silently, though. For instance:
On system boot up, I want to present old messages to the user without sound
When the application is not connected, I want to update the notifications to remove the “Reply” button, and vice versa
When an application receives a message that was posted some time in the past, I don't want to alert the user as they may have read the message elsewhere.
It works fine on L but Oreo seems to be playing sound for every notification fire or update. Is there a way to work around this behavior?
Trying to stop "Kijiji" from making noise every time I get a reply but the app has no way to disable the notification sound.
Any way to disable the notification sounds via ADB? I know you can disable vibration for specific apps so I think you can disable notification sounds also.
For example, if I open the notification channel settings for the Phone app in Android O and select the Incoming calls category, I can see that the Importance, Sound and Vibrate options are totally disabled (i.e. greyed out), so that the user cannot modify anything about them.
If I need to do this in my app, how can I do it?