我没有指定任何声音(资源),我想使用默认声音
它在Android 8和9上运行良好
但在安卓4-7上,它会在没有声音的情况下触发通知
我怎样才能在所有的Android上实现相同的行为?
Notificaiton builder:
NotificationCompat.Builder(this, channelId)
.setSmallIcon(R.drawable.notify_icon
.setContentTitle(title)
.setContentText(subtitle)
.setPriority(if (Prefs.isNotificationSound) NotificationCompat.PRIORITY_DEFAULT else NotificationCompat.PRIORITY_LOW)
.setCategory(NotificationCompat.CATEGORY_PROMO)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setAutoCancel(true)发布于 2019-06-01 22:08:02
你试过使用.setDefaults(Notification.DEFAULT_SOUND)吗?
https://stackoverflow.com/questions/56407328
复制相似问题