繁体   English   中英

我可以配置Windows 8.1平板电脑应用程序以接收吐司通知吗

[英]Can I configure my windows 8.1 TABLET application to receive toast notifications

嗨,大家好,我有一个Windows 8.1平板电脑应用程序,我想对其进行配置以接收吐司通知。 我已经完成研究,发现的唯一参考文献是配置Windows 8.1手机应用程序而不是平板电脑。 无论如何,我尝试使用相同的代码,但是我的应用程序缺少正确的程序集引用

using Microsoft.Phone.Notification;

因此,我的问题是如何配置平板电脑以接收吐司通知,或者是否可以使用替代装配参考代替上面的参考来执行与该链接相同的操作。 https://msdn.microsoft.com/en-us/library/windows/apps/hh202967(v=vs.105).aspx

Windows平板电脑不运行Windows Phone操作系统,也不使用Windows Phone Silverlight API。

Windows和Windows Phone(8.1)设备都运行Windows运行时应用程序,并使用Windows.UI.Notifications命名空间中的Windows运行时Toast系统。

您将允许该应用在其清单中使用吐司。

要在本地发送Toast,您将获得Toast模板,更新其XML以使其符合您的需要,从该XML创建ToastNotification对象,然后使用ToastNotificationManager发送它。

ToastTemplateType toastTemplate = ToastTemplateType.ToastText01; 
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);
XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");
toastTextElements[0].AppendChild(toastXml.CreateTextNode("Hello World!"));
ToastNotification toast = new ToastNotification(toastXml);
ToastNotificationManager.CreateToastNotifier().Show(toast);

要远程推送祝酒,您需要设置XML,然后将其从服务器发送到Windows Notification Server(WNS)。

Toast通知概述(Windows运行时应用程序)

快速入门:发送祝酒通知(XAML)

发送通知

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM