提醒通知有时不起作用 [英] Heads up notification do not work sometimes

查看:21
本文介绍了提醒通知有时不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以这种方式发出提醒:

I make a head up notification this way:

Notification.Builder nb = new Notification.Builder(context)
        .setSmallIcon(icon)
        .setContentTitle("Title")
        .setContentText("Content")
        .setDeleteIntent(delete)
        .setPriority(Notification.PRIORITY_HIGH)
        .setVibrate(new long[0]);

notificationManager.notify(1, nb.build()); // TODO hardcode

我第一次在测试设备上安装应用程序时,通知是抬头,但如果我扩展通知区域(当抬头仍在运行时)并从那里关闭通知,下次通知不会抬头.重新安装应用程序后,通知再次抬头.是否有任何原因导致单挑行为不能保持恒定?

First time I install application on a testing device, notifications are heads up, but if I expand notification area (while heads up is still running) and dismiss the notification from there, next time notifications are not heads up. After reinstalling the app notifications are heads up again. Are there any reasons why heads up behaviour can not be constant?

推荐答案

抬头通知具有内置的速率限制 - 如果用户向上滑动您的抬头通知(将其放回通知托盘)或侧面(关闭它),然后向系统发出信号,在一段时间内(默认为约一分钟)阻止进一步的提醒通知.

Heads up notifications have a built in rate limiting - if the user swipes your heads up notification up (putting it back into the notification tray) or to the side (dismissing it), then that signals the system to prevent further heads up notifications for some period of time (~a minute by default).

这篇关于提醒通知有时不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆