问题描述
我在更新播放声音的通知时遇到了一些问题。我有这样配置的通知频道
channel.setLightColor(Color.BLUE);
channel.enableLights(true);
channel.setShowBadge(false);
channel.setGroup(mGroup.getGroupId());
channel.setBypassDnd(true);
channel.setVibrationPattern(EMPTY_VIBRATION_PATTERN);
channel.setSound(getringtoneUri(),getringtoneAudioAttributes());
NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext,channel.getChannelId())
.setongoing(true)
.setonlyAlertOnce(true)
.setColor(ContextCompat.getColor(mContext,R.color.messenger_text))
.setPriority(NotificationCompat.PRIORITY_MAX)
.setCategory(NotificationCompat.CATEGORY_CALL)
.setVibrate(new long[]{0L})
如果我用相同的 ID 调用 notificationmanager.notify(id,notification)
两次 或 更多,通知将不会播放声音。此问题仅出现在带有 Miui 的小米设备上。有没有人熟悉它?我在哪里可以找到有关如何正确处理小米通知的文档?
附言是的,我知道小米设备有无数个允许通知的设置,我都打开了。
P.P.S 我需要更新通知。因为它显示了一些可以改变的信息,所以显示的数据应该是相关的。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)