I tried to add flutter app icon by using a package flutter_launcher_icon app icon is correct but icons shows in push notification show as a white box Notification Icon Shows as a white box
I added icons by using a package [flutter_launcher_icons]
I tried to add flutter app icon by using a package flutter_launcher_icon app icon is correct but icons shows in push notification show as a white box Notification Icon Shows as a white box
I added icons by using a package [flutter_launcher_icons]
same error have happened to me so i have used icon as xml file in android
we have to add that file name here
void showNotification(int orderCount) async {
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
var initializationSettingsAndroid = AndroidInitializationSettings('fav_icon');
var initializeSettings = InitializationSettings(android: initializationSettingsAndroid);
var res = await flutterLocalNotificationsPlugin.initialize(initializeSettings) ?? false;
Log.d("Notification manager initialized $res");
if (res) {
flutterLocalNotificationsPlugin.show(
1,
"Order",
"You have new notifications",
NotificationDetails(
android: AndroidNotificationDetails('NOTIFICATION', 'New order notifications',
channelDescription: 'Shows notifications when new orders are available',
importance: Importance.max,
priority: Priority.high,
playSound: true,
category: AndroidNotificationCategory.event,
color: MyColor.kSecondary)));
}
}