Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

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
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 ?

like image 612
SlimenTN Avatar asked Dec 16 '18 15:12

SlimenTN


1 Answers

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. Channels are required after API level 26.

like image 115
westdabestdb Avatar answered Nov 15 '22 05:11

westdabestdb