setChannel abstract method
Sets a new notification channel or updates an existing channel.
The notificationChannel
parameter is a NotificationChannel object that
represents the channel to create or update.
The optional forceUpdate
parameter is a boolean value that determines
whether to completely update the channel on Android Oreo and above, which
requires cancelling all current notifications. If this parameter is set to
false
, the channel will be updated without force the update changing the
channel key nor cancelling notifications.
This method can be used to create or update notification channels for the
app. On Android Oreo and above, updating a channel requires cancelling all
current notifications associated with the channel. If the forceUpdate
parameter is set to true
, the channel will be updated using a new key
managed by the plugin. This should only be used in emergency situations.
Implementation
Future<void> setChannel(
NotificationChannel notificationChannel, {
bool forceUpdate = false,
});