[Windows]Request for Default Icon Value for Windows Notifications in flutter_local_notifications
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!
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?
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.
I am encountering an issue where the application icon does not display in the local notification popup, despite configuring the
iconPathparameter in theWindowsInitializationSettingsas'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.
Could you just read the default icon windows\runner\resources\app_icon.ico as the Notice icon @MaikuB
Hey, just seeing this now.
- For MSIX, setting the
logo_pathon 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.icoas 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
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_pathis 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