0

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>
  1. Any ideas what has gone wrong
  2. Does the XML look correct for the image?
  3. Where exactly does ms-appdata:///local/ point to?

TIA!!

1
  • ms-appdata: is documented on MSDN: URI Schemes: ms-appdata. ms-appdata:///local/ would be your system's %APPDATA%\Local folder. Commented Feb 6 at 3:38

1 Answer 1

0

Thankfully, it turns out you can use the file scheme:

file:///C:/Path/To/Your/Image.png"
Sign up to request clarification or add additional context in comments.

1 Comment

The documented way to refer to a local image file in a toast is to use an ms-appx: uri, which can refer to the full path of a physical file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.