setCallNotificationAppearance static method

Future<void> setCallNotificationAppearance({
  1. String? smallIcon,
  2. String? accentColor,
  3. bool? colorized,
})

Configures how the incoming call notification looks.

Stored natively, so it also applies to calls raised from a data-only FCM payload while the app is dead. Call it once during startup.

  • smallIcon — drawable name for the status bar icon, e.g. 'ic_notification'. A small icon is drawn from its alpha channel only, so this must be a monochrome notification icon, never the full colour launcher icon. When omitted the plugin looks for ic_notification, ic_stat_notification and ic_stat_name in the host app before falling back to its own icon.
  • accentColor'#RRGGBB' or '#AARRGGBB', tints the icon and actions.
  • colorized — paints the whole notification in accentColor. Off by default: a light brand colour makes a colorized notification unreadable, so check it on a real device before turning it on.

Implementation

static Future<void> setCallNotificationAppearance({
  String? smallIcon,
  String? accentColor,
  bool? colorized,
}) async {
  try {
    await _channel.invokeMethod('setCallNotificationAppearance', {
      'smallIcon': smallIcon,
      'accentColor': accentColor,
      'colorized': colorized,
    });
  } on PlatformException catch (e) {
    debugPrint("Error invoking setCallNotificationAppearance: ${e.message}");
  } on MissingPluginException {
    // Non-Android platform — nothing to configure.
  }
}