Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification icon - Release build #42

Open
ChathuraHettiarachchi opened this issue Sep 10, 2021 · 4 comments
Open

Notification icon - Release build #42

ChathuraHettiarachchi opened this issue Sep 10, 2021 · 4 comments
Assignees

Comments

@ChathuraHettiarachchi
Copy link

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'));
@Alystrasz
Copy link

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!

@JulianAssmann JulianAssmann removed the bug Something isn't working label Sep 30, 2021
@PeterNjeim
Copy link

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.

@JulianAssmann JulianAssmann reopened this Dec 15, 2021
@victor-semenovich-dev
Copy link

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

@webasoo
Copy link

webasoo commented Aug 29, 2022

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

(ic_launcher_foreground is name of my icon)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants