【发布时间】:2015-10-19 10:00:56
【问题描述】:
在 Windows 8.1 商店应用程序项目中,我希望能够接收 toast 通知,然后在我的应用程序中管理它们的信息。
到目前为止,我有一个发送 toast 通知的 nodeJS 服务器,并且运行良好。
我想知道的是:首先,我如何处理收到通知的事件,其次,如果有一种方法可以在不同的页面中打开应用程序,当我单击 windows 上的 toast 通知时,取决于我得到什么吐司,例如,如果我得到一个说“你好”的吐司,我会点击它,应用程序会在 hello.xaml 页面上打开,如果我有一个说“再见”,我会在再见页面中打开应用程序.xaml。
这是我在nodejs中发送的
wns.send({
channelURI: 'https://db5.notify.windows.com/?token=ABCD',
payload: '<toast launch="launch_arguments">'+
'<visual>'+
'<binding template="ToastText03">'+
'<text id="1">Notification - ' + date.toDateString().replace(/T/, ' ').replace(/\..+/, '')+ ' ' + date.getHours() + ':'+date.getMinutes() + '.</text>'+
'<text id="1">msg 123 test 456.</text>'+
'<text id="1">bla bla bla bla</text>'+
'</binding>'+
'</visual>'+
'</toast>',
type: 'toast'
});
【问题讨论】:
标签: c# xaml windows-runtime windows-store-apps toast