[英]flutter local notification: what's the channel id?
I'm using flutter_local_notifications , and to create a notfication (let's focus on android ) you do the following: 我正在使用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);
As you can see in the android case you provide 3 parameters related to a channel 如您在android案例中所见,您提供了与频道相关的3个参数
So my quesiton is what this channel is used for and why in android we need to provide an id
, a name
and a description
to it ? 所以我的问题是此通道的用途,为什么在android中我们需要为其提供id
, name
和description
?
notification channels give us the ability to group notifications and let user interact with those channels. 通知渠道使我们能够对通知进行分组,并让用户与这些渠道进行互动。
Let's assume you are building a chat application, you can group messages coming from Alice under channel channel-alice , and you can only mute channel-alice or do different actions to it. 假设您正在构建一个聊天应用程序,可以将来自Alice的消息分组在channel channel-alice下 ,并且只能使channel-alice静音或对其执行不同的操作。 Channels are required after API level 26. API级别26之后需要通道。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.