flutter_local_notifications icon indicating copy to clipboard operation
flutter_local_notifications copied to clipboard

[Windows]Request for Default Icon Value for Windows Notifications in flutter_local_notifications

Open starwalker-2000 opened this issue 8 months ago • 6 comments

I would like to suggest implementing a default icon value for notifications on the Windows platform in the flutter_local_notifications plugin. Currently, if no icon is specified, the behavior might lead to unexpected results or require additional handling from developers. Providing a default icon would simplify the implementation process and ensure consistent notification behavior across different applications using this plugin.

This default icon could either be derived from the application's default icon or another appropriate fallback mechanism. It would enhance the developer experience and align with the ease of use expected in Flutter plugins.

Thank you!

starwalker-2000 avatar Apr 24 '25 03:04 starwalker-2000

I am encountering an issue where the application icon does not display in the local notification popup, despite configuring the iconPath parameter in the WindowsInitializationSettings as 'xxx.ico'. How should I use it?

I run the application directly from the development environment (instead of as an installed package). Is the problem related to this?

starwalker-2000 avatar Apr 24 '25 09:04 starwalker-2000

I also would like more details about the iconPath parameter for windows. Like @starwalker-2000, I am note able display an icon in the notifications area yet.

G-Ray avatar Apr 26 '25 12:04 G-Ray

I am encountering an issue where the application icon does not display in the local notification popup, despite configuring the iconPath parameter in the WindowsInitializationSettings as 'xxx.ico'. How should I use it?

I run the application directly from the development environment (instead of as an installed package). Is the problem related to this?

When packaging the application as an msix installer, I was able to get the correct icon to show in the notification when setting the absolute logo_path in the msix_config like this:

msix_config:
  logo_path: C:\Users\foo\bar.png

Without a logo path, the default flutter icon is shown after installing through msix installer.

During development, I saw no icon, despite trying multiple different iconPath parameters in the WindowsInitializationSettings

For the working msix installation, i have not set the iconPath parameter.

williamviktorsson avatar May 09 '25 12:05 williamviktorsson

Could you just read the default icon windows\runner\resources\app_icon.ico as the Notice icon @MaikuB

dickwu avatar May 14 '25 16:05 dickwu

Hey, just seeing this now.

  • For MSIX, setting the logo_path on the MSIX should be the preferred approach. I'll add that to the Windows Setup Guide
  • For debug/exe builds, I can try setting windows\runner\resources\app_icon.ico as the default value (I don't think it's going to be a relative path like that, but I'll find whatever the equivalent value is

Levi-Lesches avatar Sep 22 '25 20:09 Levi-Lesches

See https://github.com/Levi-Lesches/flutter_local_notifications/pull/1, which I'll file against this repo once #2477 is merged

Basically, it turns out that windows\runner\resources\app_icon.ico is baked into the .exe at compile-time and there is no remaining ico file left behind. That's a problem since the Windows registry really does require a full file path of an image.

So, this PR makes a breaking change to require a non-null iconAssetPath -- notice how now the icon must be a Flutter asset

  • For MSIX builds, this value is ignored (by Windows, not my code) and the logo_path is used
  • For debug/exe builds, the Flutter asset provided is used instead

I also added to the docs that in all modes, you can override the icon for any given notification by using a WindowsImage with WindowsImagePlacement.appLogoOverride

Levi-Lesches avatar Nov 13 '25 06:11 Levi-Lesches