[英]Can I configure my windows 8.1 TABLET application to receive toast notifications
Hi Guys I have a windows 8.1 tablet application that I want to configure to receive toast notifications. 嗨,大家好,我有一个Windows 8.1平板电脑应用程序,我想对其进行配置以接收吐司通知。 I have done my research and the only references I have found are to configure a windows 8.1 phone app not tablet.
我已经完成研究,发现的唯一参考文献是配置Windows 8.1手机应用程序而不是平板电脑。 Anyway I tried to use the same code but my app is missing the right assembly references
无论如何,我尝试使用相同的代码,但是我的应用程序缺少正确的程序集引用
using Microsoft.Phone.Notification;
So my question is how do I configure my tablet to receive toast notifications or is there an alternative assembly reference that I can use instead of the one above to do something similar to what they have at this link. 因此,我的问题是如何配置平板电脑以接收吐司通知,或者是否可以使用替代装配参考代替上面的参考来执行与该链接相同的操作。 https://msdn.microsoft.com/en-us/library/windows/apps/hh202967(v=vs.105).aspx
https://msdn.microsoft.com/en-us/library/windows/apps/hh202967(v=vs.105).aspx
Windows Tablets don't run the Windows Phone OS and don't use the Windows Phone Silverlight API. Windows平板电脑不运行Windows Phone操作系统,也不使用Windows Phone Silverlight API。
Both Windows and Windows Phone (8.1) devices run Windows Runtime apps and use the Windows Runtime toast system from the Windows.UI.Notifications namespace. Windows和Windows Phone(8.1)设备都运行Windows运行时应用程序,并使用Windows.UI.Notifications命名空间中的Windows运行时Toast系统。
You'll enable the app to use toasts in the app's manifest. 您将允许该应用在其清单中使用吐司。
To send the toast locally you'll get the toast template, update its XML to match what you need, create a ToastNotification object from that XML, then send it with the ToastNotificationManager. 要在本地发送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);
To push a toast remotely you'll set up the XML and then send it to the Windows Notification Server (WNS) from your server. 要远程推送祝酒,您需要设置XML,然后将其从服务器发送到Windows Notification Server(WNS)。
Toast notification overview (Windows Runtime apps) Toast通知概述(Windows运行时应用程序)
Quickstart: Sending a toast notification (XAML) 快速入门:发送祝酒通知(XAML)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.