简体   繁体   中英

How to clear notifications from windows phone 8.1 programmatically

In windows phone 8.1 all the notifications don't get clear when we open the app by tapping on the notification

在此处输入图片说明

So I am trying to clear my app's push notifications programmatically in the OnAppLaunched event

private void OnAppLaunched(object state)
{
    var toastNotificationManager = Windows.UI.Notifications.ToastNotificationManager.History;
    toastNotificationManager.Clear();
}

But it is not working from me. So can anyone help me with this ?

The Clear method deletes all the notifications created by your app only. There are a couple more clear methods (see the docs ), but there is none to clear all the notifications from all the apps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM