简体   繁体   English

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

[英]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)

Sending notifications 发送通知

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

相关问题 通过pushwoosh推送Windows Phone 8.1的Toast通知 - Push Toast Notifications for windows Phone 8.1 by pushwoosh 在Windows Store App 8.1中管理吐司通知 - Managing toast notifications in windows store app 8.1 我如何为我的应用程序接收吐司? - How can I receive toast for my app? windows 8.1 平板电脑应用程序开发 - 从哪里开始? - windows 8.1 tablet application development - Where to start? 我可以在不将Windows 8.1应用程序注册到应用商店的情况下使用WNS发送通知吗? - Can I send notifications using WNS without registering my windows 8.1 app to the app store 如何发送和接收Windows Phone 8.1的推送通知 - How to send and receive push notifications for Windows Phone 8.1 为什么我不能从C#向Windows Phone 8.1发送WNS吐司通知 - why can't I send WNS toast notification from c# to windows phone 8.1 如何从应用程序外部获取Toast通知? - How can i get my Toast Notification from outside the application? 了解Toast推送通知以及如何在其上显示文本并通过按它们启动应用程序。 Windows Phone 8.1 - Understanding Toast push notifications and how to display text on them and launch app by pressing on them. Windows Phone 8.1 屏幕键盘-Windows 8.1平板电脑 - On Screen keyboard - Windows 8.1 Tablet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM