Notifications 如何避免在UWP上启动应用程序时发出调度通知?
我的应用程序上有一种闹钟 它工作正常,但当它完成时,我只想弹出通知。我有一个按钮要关闭,还有一个按钮要打盹。一旦点击,他们都会打开应用程序。我不想要这种行为。我所需要的就是打盹儿或是把它打发掉,就这样 可能吗 我是这样做的:Notifications 如何避免在UWP上启动应用程序时发出调度通知?,notifications,uwp,xamarin.forms,Notifications,Uwp,Xamarin.forms,我的应用程序上有一种闹钟 它工作正常,但当它完成时,我只想弹出通知。我有一个按钮要关闭,还有一个按钮要打盹。一旦点击,他们都会打开应用程序。我不想要这种行为。我所需要的就是打盹儿或是把它打发掉,就这样 可能吗 我是这样做的: var xmlString = @"<toast launch='args' scenario='alarm'> <visual> <binding template='ToastGeneric'
var xmlString = @"<toast launch='args' scenario='alarm'>
<visual>
<binding template='ToastGeneric'>
<text>" + alertAction + @"</text>
<text>" + alertBody + @"</text>
</binding>
</visual>
<actions>
<action arguments = 'snooze'
content = 'Snooze' />
<action arguments = 'dismiss'
content = 'Dismiss' />
</actions>
</toast>";
var doc = new Windows.Data.Xml.Dom.XmlDocument();
doc.LoadXml(xmlString);
var toast = new ScheduledToastNotification(doc, DateTimeOffset.Now.AddMinutes(durationInMinutes), new TimeSpan(0, 0, 300), 5);
toast.Id = id;
ToastNotificationManager.CreateToastNotifier().AddToSchedule(toast);
var xmlString=@”
“+alertAction+@”
“+alertBody+@”
";
var doc=new Windows.Data.Xml.Dom.XmlDocument();
doc.LoadXml(xmlString);
var toast=newscheduledtoastnotification(doc,DateTimeOffset.Now.AddMinutes(durationInMinutes),newtimespan(0,0300),5);
toast.Id=Id;
ToastNotificationManager.CreateToastNotifier().AddToSchedule(toast);
您当前的操作将生成一个ToastButton类型,这是正常的activationType
&点击时将激活应用程序。如果不想激活应用程序,请将activationType
声明为system
尝试使用
<actions hint-systemCommands = 'SnoozeAndDismiss' />
您当前的操作将生成ToastButton类型,这是正常的
activationType
&点击时将激活应用程序。如果不想激活应用程序,请将activationType
声明为system
尝试使用
<actions hint-systemCommands = 'SnoozeAndDismiss' />
这就成功了。谢谢请问在哪里可以找到这些xml定制选项?我就是找不到它。@Dpedrinha你也可以在中找到它,就像上面做的一样。谢谢请问在哪里可以找到这些xml定制选项?我就是找不到。@Dpedrinha您也可以在中找到它,同上