Search code examples
c#uwptoast

How to remove history change event of toast notification on actin button click?


I have 2 background tasks that trigger for toast notifications.

  1. ToastActivationTask: This is a ActionTriggerDetail task. Triggered on action button click.
  2. TrackToastNotificationTask: This is a HistoryChangedTriggerDetail task. Triggered when history of toast is changed.

I have 2 buttons on the toast, Yes and Not Now. When the buttons are clicked both the tasks are triggered as the button click also changes the history of the toast.

I can only see one of the two possible solution:

  1. When the action buttons are clicked only ToastActivationTask is triggered. OR.
  2. History of the toast doesn't change on action button click.

Please help.


Solution

  • How to remove history change event of toast notification on actin button click?

    Unfortunately, we could not remove HistoryChangedTriggerDetail, if you have register it, it is by design. Derive from this case reply.

    Subscribing this trigger, will allow your app to get notified when:

    • A toast notification is removed by the user from action center;
    • A toast notification is expired and removed by the system from action center;
    • A toast notification is delivered form your app, via push;

    If you click actin button, the toast will remove by default. so ToastNotificationHistoryChangedTrigger and ToastNotificationActionTrigger will be invoked at same time.