Android Notification Channel silent ringtone by default

902 Views Asked by At

I want to create a Notification Channel for Android Oreo where the default sound is silent, I've tried to not specify the sound and it still plays a sound when the notification is dispatched. Any ideas?

NotificationChannel chan2 = new NotificationChannel(SECONDARY_CHANNEL,
            getString(R.string.noti_channel_second), 
NotificationManager.IMPORTANCE_HIGH);
    chan2.setLightColor(Color.BLUE);
    chan2.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
    getManager().createNotificationChannel(chan2);
1

There are 1 best solutions below

1
On

add chan2.setSound(null, null); when creating the channel.