1
votes

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

enter image description here

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 ?

1
ToastNotificationHistory.Clear() should do it. If not then there's something going on beyond what you mention in your description here. How are these notifications sent? Are any of the notifications cleared? Some? None? Does it work if you call it elsewhere (for testing, try a button Click)?Rob Caplan - MSFT

1 Answers

0
votes

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.