是否可以在 Android O 中静默更新通知?
Is it possible to update a notification silently in Android O?
以前我使用 setSound(null),但是对于新的通知渠道,这不起作用。
所以我可以创建另一个显示通知更新的频道(已经有大约 10 个)并将该频道设置为声音的空值?这是解决这个问题的唯一方法吗?如果用户足够愚蠢(总是有一些)为这个类别设置声音,他将在我们更新现有警报时获得多种声音。
您尝试过使用 NotificationCompat.Builder.setOnlyAlertOnce()
吗?
Set this flag if you would only like the sound, vibrate and ticker to
be played if the notification is not already showing.
它似乎完全符合您的要求。 :)
以前我使用 setSound(null),但是对于新的通知渠道,这不起作用。
所以我可以创建另一个显示通知更新的频道(已经有大约 10 个)并将该频道设置为声音的空值?这是解决这个问题的唯一方法吗?如果用户足够愚蠢(总是有一些)为这个类别设置声音,他将在我们更新现有警报时获得多种声音。
您尝试过使用 NotificationCompat.Builder.setOnlyAlertOnce()
吗?
Set this flag if you would only like the sound, vibrate and ticker to be played if the notification is not already showing.
它似乎完全符合您的要求。 :)