最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

xml - App notification (Toast) breaks when adding image - Stack Overflow

programmeradmin0浏览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!!

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!!

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
  • 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
Add a comment  | 

1 Answer 1

Reset to default 0

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

file:///C:/Path/To/Your/Image.png"
发布评论

评论列表(0)

  1. 暂无评论