I can send Toast notifications with buttons just fine, but when I add an image it seems to balk and just put up a generic "New Notification" box without the text, buttons or image.
The xml
looks like:
<toast><visual><binding template='ToastGeneric'><text>My Main Line Notification</text><text>My additional line of details.</text><image placement='appLogoOverride' hint-crop='circle' src='ms-appdata:///local/info48x48.png'/></binding></visual><actions><action content="Button1" arguments="0" /><action content="Button2" arguments="1" /></actions></toast>
I copied a .png file named info48x48.png
to several locations to try:
%APPDATA%\..\local\NameOfExeWithoutExtension
%APPDATA%\..\local\NameOfShortutThatShowsInTitle
%APPDATA%\..\local\AppId.The.One.With.Dots
%APPDATA%\..\local\packages\AppId.The.One.With.Dots
but alas, it doesn't like something about the XML
above. This works (removed image):
<toast><visual><binding template='ToastGeneric'><text>My Main Line Notification</text><text>My additional line of details.</text></binding></visual><actions><action content="Button1" arguments="0" /><action content="Button2" arguments="1" /></actions></toast>
- Any ideas what has gone wrong
- Does the XML look correct for the image?
- Where exactly does
ms-appdata:///local/
point to?
TIA!!
I can send Toast notifications with buttons just fine, but when I add an image it seems to balk and just put up a generic "New Notification" box without the text, buttons or image.
The xml
looks like:
<toast><visual><binding template='ToastGeneric'><text>My Main Line Notification</text><text>My additional line of details.</text><image placement='appLogoOverride' hint-crop='circle' src='ms-appdata:///local/info48x48.png'/></binding></visual><actions><action content="Button1" arguments="0" /><action content="Button2" arguments="1" /></actions></toast>
I copied a .png file named info48x48.png
to several locations to try:
%APPDATA%\..\local\NameOfExeWithoutExtension
%APPDATA%\..\local\NameOfShortutThatShowsInTitle
%APPDATA%\..\local\AppId.The.One.With.Dots
%APPDATA%\..\local\packages\AppId.The.One.With.Dots
but alas, it doesn't like something about the XML
above. This works (removed image):
<toast><visual><binding template='ToastGeneric'><text>My Main Line Notification</text><text>My additional line of details.</text></binding></visual><actions><action content="Button1" arguments="0" /><action content="Button2" arguments="1" /></actions></toast>
- Any ideas what has gone wrong
- Does the XML look correct for the image?
- Where exactly does
ms-appdata:///local/
point to?
TIA!!
Share Improve this question edited Feb 6 at 1:34 user3161924 asked Feb 6 at 1:20 user3161924user3161924 2,3151 gold badge23 silver badges42 bronze badges 1 |1 Answer
Reset to default 0Thankfully, it turns out you can use the file scheme:
file:///C:/Path/To/Your/Image.png"
ms-appdata:
is documented on MSDN:URI Schemes: ms-appdata
.ms-appdata:///local/
would be your system's%APPDATA%\Local
folder. – Remy Lebeau Commented Feb 6 at 3:38