I'm using the flutter_local_notifications
package to show foreground notifications on Android. On most devices, the notification icon (logo) appears correctly both in collapsed and expanded views. However, on the Redmi C13(Android 14), the logo does not appear in the expanded notification view — it's just blank space where the icon should be.
Here's the code I'm using to display the notification:
Future<void> showRegularNotification(
RemoteNotification notification,
RemoteMessage message,
) async {
await _localNotifications.show(
notification.hashCode,
notification.title,
notification.body,
NotificationDetails(
android: AndroidNotificationDetails(
_androidChannel.id,
_androidChannel.name,
channelDescription: _androidChannel.description,
icon: '@mipmap/ic_launcher',
),
),
payload: jsonEncode(message.toMap()),
);
}
I've confirmed that:
@mipmap/ic_launcher
exists and is used as the app launcher icon.
The collapsed view shows the icon correctly; the problem is only in the expanded view.
I have attached some screen shot references.
Yes, In some devices getting issue so follow below steps
Check Icon is proper or not
Icon should be white-only transparent and PNG format .
Icon should be in the in res/drawable
folder.
For Ex. android/app/src/main/res/drawable/demo.png.
set icon in notification service class like below
const NotificationDetails(
android: AndroidNotificationDetails(
'test_channel_id',
'Test Channel',
icon: 'ic_stat_notify', // same as in initialization
importance: Importance.high,
priority: Priority.high,
),
),
Set below 2 android permission in Android Menifest File
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
hope it helps!