代码拉取完成,页面将自动刷新
本示例主要展示了通知过滤回调管理的功能,使用@ohos.notificationManager 接口,进行通知监听回调,决定应用通知是否发送。
通知过滤关闭 | 通知过滤开启 |
---|---|
使用说明
entry/src/main/ets/
|---feature
| |---NotificationFilterUtil.ets // 对外提供通知过滤的接口
|---entryability
|---pages
| |---Index.ets // 首页
|---util
| |---Logger.ets // 日志工具
ohos.permission.NOTIFICATION_CONTROLLER
ohos.permission.NOTIFICATION_AGENT_CONTROLLER
通知发送依赖于自定义通知角标应用, 进行不同类型通知的发送测试。
如需单独下载本工程,执行如下命令:
git init
git config core.sparsecheckout true
echo code/BasicFeature/Notification/CustomNotificationPush/ > .git/info/sparse-checkout
git remote add origin https://gitee.com/openharmony/applications_app_samples.git
git pull origin master
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。