iMobaio
iMobaio

Reputation: 266

Android Notification Channel silent ringtone by default

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);

Upvotes: 1

Views: 902

Answers (1)

Pnemonic
Pnemonic

Reputation: 1825

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

Upvotes: 1

Related Questions