android - 颤动本地通知:频道ID是什么?
问题描述
我正在使用flutter_local_notifications,要创建一个通知(让我们关注 android ),您可以执行以下操作:
var androidPlatformChannelSpecifics =
new AndroidNotificationDetails(
'your other channel id',
'your other channel name',
'your other channel description');
var iOSPlatformChannelSpecifics =
new IOSNotificationDetails();
NotificationDetails platformChannelSpecifics = new NotificationDetails(
androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
正如您在 android 案例中看到的那样,您提供了与通道相关的 3 个参数
所以我的问题是该通道的用途以及为什么在 android 中我们需要为其提供 a id
、 aname
和 a description
?
解决方案
通知渠道使我们能够对通知进行分组并让用户与这些渠道进行交互。
假设您正在构建一个聊天应用程序,您可以将来自Alice的消息分组到频道channel-alice下,并且您只能静音channel-alice或对其执行不同的操作。API 级别 26 之后需要通道。
推荐阅读
- regex - rtf文件的perl替换中的奇怪替换行为
- c++ - 调用或不调用 abs() 函数,取决于模板类型是无符号的,如果可能的话?
- android - Ask - 访问内置笔记应用 IOS 和 Android - React Native
- automapper - Automapper & EF Core:DTO 暴露的一对多关系
- python - 如何将“硬币兑换问题”应用于熊猫数据框?
- c# - 如何解决列'empID'不属于表?
- excel - ListOjbect 和 TableObject 的关系
- python - 如何在 Python 中使用带有嵌套 if 语句的 while 循环
- r - 根据 r 中 data.table 中的多个条件创建列
- html - 如何在倒梯形(形状)内写文字?