admin管理员组

文章数量:1122832

Hi i am using awesome notification to show notification so its working fine but showing white circle instead of app logo i tried many ways

1.pass resource://drawable/ic_launcher_foreground

2.modify manifest file and more

but its not working

static Future<void> initialize() async {
    await AwesomeNotifications().initialize(
        null,
        [
          NotificationChannel(
            channelKey: 'high_importance_channel',
            channelName: 'Alerts',
            channelDescription: 'Alerts',
            playSound: true,
            defaultRingtoneType: DefaultRingtoneType.Notification,
            enableVibration: true,
            defaultColor: Colors.amber,
            enableLights: true,
            importance: NotificationImportance.High,
            defaultPrivacy: NotificationPrivacy.Private,
          )
        ],
        debug: false);
    initialAction = await AwesomeNotifications()
        .getInitialNotificationAction(removeFromActionEvents: false);
  }

Hi i am using awesome notification to show notification so its working fine but showing white circle instead of app logo i tried many ways

1.pass resource://drawable/ic_launcher_foreground

2.modify manifest file and more

but its not working

static Future<void> initialize() async {
    await AwesomeNotifications().initialize(
        null,
        [
          NotificationChannel(
            channelKey: 'high_importance_channel',
            channelName: 'Alerts',
            channelDescription: 'Alerts',
            playSound: true,
            defaultRingtoneType: DefaultRingtoneType.Notification,
            enableVibration: true,
            defaultColor: Colors.amber,
            enableLights: true,
            importance: NotificationImportance.High,
            defaultPrivacy: NotificationPrivacy.Private,
          )
        ],
        debug: false);
    initialAction = await AwesomeNotifications()
        .getInitialNotificationAction(removeFromActionEvents: false);
  }

Share Improve this question asked Nov 21, 2024 at 13:00 Hari A.RHari A.R 276 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

create an icon in this route

android/app/src/main/res/drawable/your_icon_name.png

then edit your code to this

static Future<void> initialize() async {
    await AwesomeNotifications().initialize(
        "resource://drawable/your_icon_name",
        [
          NotificationChannel(
            channelKey: 'high_importance_channel',
            channelName: 'Alerts',
            channelDescription: 'Alerts',
            playSound: true,
            defaultRingtoneType: DefaultRingtoneType.Notification,
            enableVibration: true,
            defaultColor: Colors.amber,
            enableLights: true,
            importance: NotificationImportance.High,
            defaultPrivacy: NotificationPrivacy.Private,
          )
        ],
        debug: false);
    initialAction = await AwesomeNotifications()
        .getInitialNotificationAction(removeFromActionEvents: false);
  }

after do that restart your application

本文标签: flutterAwesome notification icon not showingStack Overflow