I am creating a notification with Android's NotificationManager.
Is it possible to 'override' the phone's volume (mute) settings in such a way, that the notification's sound is ALWAYS played?
The reason I need this is the following: The notification is so important, that vibration alone may not be enough. The user MUST be alerted. So a sound shall be played, even if the phone is muted or the volume is very low.
Question: Q: iphone 11 plays sound even when on silent mode First, check to see if Do Not Disturb is turned on. If it is turned on, check the setting for "Allow Calls From." If this is set to Favorites it will allow calls from those who are on your Favorites list.
Your iPhone's audio system is apparently glitching because it still plays notification sounds even when it's already set to silent. Many people who have encountered the same issue for the first time have found a quick fix by simply switching silent mode off and then on again shortly.
ANSWER: Go to Settings/Reminders and look for Today Notification. This will chime at a set time for any All-Day reminders. Turn it off and your sounds may stop. Also check Settings/Notifications for apps that may have only Sound turned on and no Badges or Banners turned on as suggested in other answers.
yes it is possible,
MediaPlayer mMediaPlayer;
Uri notification = null;
notification = RingtoneManager
.getDefaultUri(RingtoneManager.TYPE_ALARM);
mMediaPlayer = new MediaPlayer();
mMediaPlayer.setDataSource(ctx, notification);
// mMediaPlayer = MediaPlayer.create(ctx, notification);
final AudioManager audioManager = (AudioManager) ctx
.getSystemService(Context.AUDIO_SERVICE);
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM);
mMediaPlayer.prepare();
// mMediaPlayer.start();
mMediaPlayer.setLooping(true);
mMediaPlayer.setOnPreparedListener(new OnPreparedListener() {
public void onPrepared(MediaPlayer arg0) {
mMediaPlayer.seekTo(0);
mMediaPlayer.start();
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With