Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Creating Scheduled Toast Notifications #21

Open
derrickberg-dev opened this issue Oct 5, 2020 · 2 comments
Open

Issue Creating Scheduled Toast Notifications #21

derrickberg-dev opened this issue Oct 5, 2020 · 2 comments

Comments

@derrickberg-dev
Copy link

derrickberg-dev commented Oct 5, 2020

Hello,

Could you test creating scheduled toast notifications without ever calling the CreateToastNotifier.Show() function?

If my app just creates scheduled toast notifications, it doesn't seem to work. One thing I tested was creating a build that creates notifications immediately using .show(), then replacing it with the one that uses AddToSchedule and then it starts working. There must be something that .show() is doing that AddToSchedule isn't, because until I call show() I never see my app in the Notification & Actions section of the Windows Settings. But, I don't see anything in the documentation on scheduled notifications that indicate this....

https://github.com/MicrosoftDocs/windows-uwp/blob/docs/windows-apps-src/design/shell/tiles-and-notifications/scheduled-toast.md

Doesn't work...

            var toast = new ScheduledToastNotification(toastContent.GetXml(), DateTime.Now.AddSeconds(5));
            DesktopNotificationManagerCompat.CreateToastNotifier().AddToSchedule(toast);

Will work...

                ToastNotification toast = new ToastNotification(toastContent.GetXml());
                DesktopNotificationManagerCompat.CreateToastNotifier().Show(toast);

                var toast = new ScheduledToastNotification(toastContent.GetXml(), DateTime.Now.AddSeconds(5));
                DesktopNotificationManagerCompat.CreateToastNotifier().AddToSchedule(toast);
@derrickberg-dev derrickberg-dev changed the title Creating Scheduled Toast Notifications Issue Creating Scheduled Toast Notifications Oct 5, 2020
@derrickberg-dev
Copy link
Author

I can build a version that creates 1 notification using .show() then delete it and replace it with the version that only uses .AddToSchedule() to create notifications and everything works.

What does calling .show() do in the background that .AddToSchedule() isn't doing? I see that using .show() winds up putting my app in the Notifications & Actions, where .AddToSchedule() never would.

@derrickberg-dev
Copy link
Author

Hey @andrewleader, I noticed you have a repo for testing toast notifications https://github.com/andrewleader/NotifTestApps

Got any ideas? Have you tested ScheduledToastNotifications before?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant