c# - Send template-notification to tile and toast once -


i register 2 different templates windowsphone clients (one tile-update , 1 toasts).

is there possibility send 1 notification , windowsphone clients getting toast notification , tile update?

i found forum thread on msdn following message (in answer):

if call method sendtemplatenotificationasync({“properties of template”}, “en-us”)) this, target toast , tile both notifications device a.

but won't work me. client gets tile-update , not toast notification.

i tried template both in xml (tile , toast). found here. won't work (only toast visible on client).

i know, can work additional tags (like "toast" , "tile") , send notifications following code snippet. think ugly solution:

await hubclient.sendtemplatenotificationasync(content, tags + " && toast"); await hubclient.sendtemplatenotificationasync(content, tags + " && tile"); 

any appreciated. thanks

edit: templates , notification-properties:

properties:

var content = new dictionary<string, string> {     {"title_en", "english title"},     {"message_en", "english content"},     {"title_de", "deutscher titel"},     {"message_de", "deutscher inhalt"},     {"url", url},     {"count", count.tostring()} }; 

toast-template (windowsphone)

string.format("<?xml version=\"1.0\" encoding=\"utf-8\"?>" +     "<wp:notification xmlns:wp=\"wpnotification\">" +     "<wp:toast>" +     "<wp:text1>$(title_{0})</wp:text1>" +     "<wp:text2>$(message_{0})</wp:text2>" +     "<wp:param>$(url)</wp:param>" +     "</wp:toast>" +     "</wp:notification>", language); 

tile-template (windowsphone)

string.format("<?xml version=\"1.0\" encoding=\"utf-8\"?>" +     "<wp:notification xmlns:wp=\"wpnotification\">" +     "<wp:tile template=\"iconictile\">" +     "<wp:smalliconimage>small.png</wp:smalliconimage>" +     "<wp:iconimage>large.png</wp:iconimage>" +     "<wp:widecontent1>$(title_{0})</wp:widecontent1>" +     "<wp:widecontent2>$(message_{0})</wp:widecontent2>" +     "<wp:widecontent3 action=\"clear\"></wp:widecontent3>" +     "<wp:count>$(count)</wp:count>" +     "<wp:title>appname</wp:title>" +     "</wp:tile>" +     "</wp:notification>", language) 

await hubclient.sendtemplatenotificationasync(content, tags + " && toast"); await hubclient.sendtemplatenotificationasync(content, tags + " && tile"); 

this not ugly solution, there reason behind it.selection of

template/registration based on tags not based on payload keys. you've registered templates different set of tags =>

device - toast template,  tags: {"en-us", "toast"} device - tile template , tags : {"en-us", "tile"} 

in case device tile template registered tags : {"en-us", "tile"} , toast tags: {"en-us", "toast"} , these 2 registrations different can't send them in single request.

imo can't have both notification single call => sendtemplatenotificationasync({“properties of template”}, “en-us”))' because again imo(as not able work out time before) notification hub not able decide template (tile, toast) has send device. because each of them registered different tags set mentioned above.

also why not ugly solution, because gives more control on notifications because know toast , tile notifications have different purpose, simultaneously don't provide value.

tile notification => used info can last long time , not stale sooner. counter, image, new update etc. info not require instant user's attention immediately.

toast notification => used sending out info quite instant(hope understand mean).like new message came, have released new update etc.

if send 2 notification simultaneously time in case not add value.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -