flutter_background
flutter_background copied to clipboard
Notification icon - Release build
This was strange. I tested the application on debug mode and the icon I'm providing is getting displayed correctly. But when tested with release build after flutter clean, icon just showing grey squre.
static final androidConfig = FlutterBackgroundAndroidConfig(
notificationTitle: NOTIFICATION_TITLE,
notificationText: NOTIFICATION_TEXT,
notificationImportance: AndroidNotificationImportance.Default,
notificationIcon:
AndroidResource(name: "ic_app", defType: 'mipmap'));
Hello @ChathuraHettiarachchi,
Your problem is not linked to flutter_background
package, but rather to your icon files.
Android notification icons should not feature other colors than white (you can still include some alpha).
Check out https://clevertap.com/blog/fixing-notification-icon-for-android-lollipop-and-above/ for more details!
I'm facing the same issue. The icon appears properly in debug mode, but does not appear properly in release mode. My icon is white with some slightly transparent white areas. So I decided to test with a pure white icon, either fully opaque or fully transparent pixels, same thing. If it was truly an icon issue, it wouldn't work in either debug mode or release mode, something else is happening here.
I also have the same problem. The icon is not displayed in the release mode.
generate drawer resource and then :
AndroidResource( name: '@drawable/ic_launcher_foreground', defType: 'drawable')
(ic_launcher_foreground is name of my icon)