问题描述
我正在为UWP进行Toast通知并使用Microsoft.UI.Notifications.ScheduledToastNotification。
I am working on toast notifications for UWP and using Microsoft.UI.Notifications.ScheduledToastNotification.
每当我尝试使用贪睡选项安排通知时,都不会打盹。通知只会触发一次,不会重复。我使用的是ScheduledToastNotification构造函数,其中的参数包括XmlContent,
DeliveryTime,SnoozeInterval和 MaximumSnoozeCount。
Whenever I try to schedule a notification with snooze option, it is not snoozing. The notification will be triggered just once and there is no repetition. I am using the ScheduledToastNotification constructor in which parameters include XmlContent, DeliveryTime, SnoozeInterval and MaximumSnoozeCount.
以下是代码段:
var scheduledToast = new ScheduledToastNotification(content, startTime, TimeSpan.FromSeconds(90), 3);
//content includes just the title and the message for the toast notification
scheduledToast.Id = "notificationId";
scheduledToast.Group = "categoryId";
ToastNotifier toastNotifier = ToastNotificationManager.CreateToastNotifier();
toastNotifier.AddToSchedule(scheduledToast);
我是否遗漏了某些东西或是否存在任何问题?
Am I missing something or is there any issue with the same?
Rohit Garg。
Rohit Garg.
推荐答案
我建议您查看集合,其中还包括Toast通知
i would recommend to take a look at the https://docs.microsoft.com/en-us/windows/uwpcommunitytoolkit/ collection which also includes toast notifications
br
Andre
br
Andre
这篇关于[UWP] [C#] ToastNotification Snooze在UWP中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!