Miro
Miro

Reputation: 442

Scheduled Toast showing multiple times

I have a calendar application which has the ability to set pill reminders.

ScheduledToastNotification recurringToast = new ScheduledToastNotification(
toastXml,startDay.AddDays(1), new TimeSpan(0, 0, 1, 0), 3);

As you can see it has MaxSnoozeCount = 3 and SnoozeInterval = 1 minute. The problem is that when I click the appearing toast as the documentation states the toast should be shown again because it hasn't been "snoozed". Yet it appears exactly 4 times regardless of the fact that I click it each single time.

Any ideas what is wrong? Thanks.

Upvotes: 1

Views: 208

Answers (1)

Nathan Kuchta
Nathan Kuchta

Reputation: 14182

Upon clicking on the scheduled toast, your app should handle the toast activation event and remove the scheduled toast to prevent it from being seen again. A scheduled toast will continue to be shown based on its creation parameters until an application explicitly removes it from the schedule.

Use ToastNotifier.GetScheduledToastNotifications to retrieve the toast of interest, and then call ToastNotifier.RemoveFromSchedule to stop it from being displayed in the future.

Upvotes: 2

Related Questions