簡體   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