未显示预定的Toast通知 [英] Scheduled Toast Notification not displayed

查看:93
本文介绍了未显示预定的Toast通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下面的方法中,On调用执行时没有任何错误或异常。但是在上述时间跨度之后没有显示通知。我们是否还需要预定的Toast Notifications的更多属性设置?

Below method, On call executes without any error or exception. But notification is not displayed after the mentioned time span. Do we need any more property settings for scheduled Toast Notifications?

public void toast_notifier()

        {

            XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);

public void toast_notifier()
        {
            XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);

            XmlNodeList stringElements = toastXml.GetElementsByTagName(" text");

            stringElements.Item(0).AppendChild(toastXml.CreateTextNode(" Scheduled Toast"));

            XmlNodeList stringElements = toastXml.GetElementsByTagName("text");
            stringElements.Item(0).AppendChild(toastXml.CreateTextNode("Scheduled Toast"));

       

            DateTimeOffset displayTime = DateTimeOffset.UtcNow.AddSeconds(3);

       
            DateTimeOffset displayTime = DateTimeOffset.UtcNow.AddSeconds(3);

            ScheduledToastNotification scheduledToast = new ScheduledToastNotification(toastXml,displayTime);

            ScheduledToastNotification scheduledToast = new ScheduledToastNotification(toastXml, displayTime);

          

            scheduledToast.Id =" FutureToast";

          
            scheduledToast.Id = "FutureToast";

           

            ToastNotifier notifier = ToastNotificationManager.CreateToastNotifier();

            notifier.AddToSchedule(scheduledToast);

           
            ToastNotifier notifier = ToastNotificationManager.CreateToastNotifier();
            notifier.AddToSchedule(scheduledToast);

          }

          }

推荐答案

嗨编码器,

这对我来说是正确的。 $ b中的预定播送方案$ b Advanced Toasts Sample 适用于你?

That looks correct to me. Does the scheduled toast scenario in the Advanced Toasts Sample work for you?

你的包清单中是否启用了toasts?你可以让计划外的祝酒词上班吗?

Do you have toasts enabled in your package manifest? Can you get unscheduled toasts to work?

- Rob


这篇关于未显示预定的Toast通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆