NotificationChannel 为我之前没有声音的通知添加了声音
NotificationChannel added sound to my notification that didn't have sound before
将此添加到我的代码后:
mBuilder.setPriority(NotificationCompat.PRIORITY_LOW)
int importance = NotificationManager.IMPORTANCE_LOW;
notificationChannel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, importance);
notificationChannel.enableLights(false);
notificationChannel.enableVibration(false);
notificationManager.createNotificationChannel(notificationChannel);
mBuilder.setChannelId(NOTIFICATION_CHANNEL_ID);
我以前没有声音的通知现在有声音了。在我的通知生成器上,我已将优先级切换为低,因为我读到它可以发出声音,现在我真的不知道还能做什么。
有什么想法吗?
谢谢。
事实证明,频道一旦创建,它的重要性就永远存在。删除频道解决了这个问题。
将此添加到我的代码后:
mBuilder.setPriority(NotificationCompat.PRIORITY_LOW)
int importance = NotificationManager.IMPORTANCE_LOW;
notificationChannel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, importance);
notificationChannel.enableLights(false);
notificationChannel.enableVibration(false);
notificationManager.createNotificationChannel(notificationChannel);
mBuilder.setChannelId(NOTIFICATION_CHANNEL_ID);
我以前没有声音的通知现在有声音了。在我的通知生成器上,我已将优先级切换为低,因为我读到它可以发出声音,现在我真的不知道还能做什么。
有什么想法吗?
谢谢。
事实证明,频道一旦创建,它的重要性就永远存在。删除频道解决了这个问题。