flutter_background icon indicating copy to clipboard operation
flutter_background copied to clipboard

Notification icon - Release build

Open ChathuraHettiarachchi opened this issue 3 years ago • 4 comments

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'));

ChathuraHettiarachchi avatar Sep 10 '21 12:09 ChathuraHettiarachchi

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!

Alystrasz avatar Sep 30 '21 08:09 Alystrasz

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.

PeterNjeim avatar Dec 15 '21 00:12 PeterNjeim

I also have the same problem. The icon is not displayed in the release mode.

victor-semenovich-dev avatar Apr 13 '22 08:04 victor-semenovich-dev

generate drawer resource and then : AndroidResource( name: '@drawable/ic_launcher_foreground', defType: 'drawable')

(ic_launcher_foreground is name of my icon)

webasoo avatar Aug 29 '22 14:08 webasoo