I’m developing wp7 Mango application. I run PeriodicTask and want to notify user according to some conditions. I’m using ShellToast for notification. But to my mind its isn’t enough for my purpose. First of all ShellToast disappears after some time and user can easy miss this notification. Secondary that doesn’t work when application runs. And minor issue – notification’s sound is very quiet.
Reminder is more suitable for me. It is loud and doesn’t disappear till user close it. But it isn’t possible to create Reminder from background thread, so I’ve created Reminder on foreground side and set BeginTime = DateTime.MaxValue. On the background I just use ScheduledActionService.Find("ReminderName") for extracting Reminder and change BeginTime property to DateTime.Now. Unfortunately without success.
Does anybody has idea how to rise Reminder through PeriodicTask?
As you’ve discovered, it’s not permitted to set a reminder from a BackgroundTask.
I think you would benefit by considering things from the users persective. As a user:
– would you an app that kept raising notifications that you had to respond to?
– would you want an app ignored the conventions of the platform
– would you want an app that always made loud noises? even if you turned the volume down?
If it’s really vital to your app that you notify the user in a more prominent way you coudl send an SMS via an external service.
Or you could have the user subscribe to a web based calendar and then add your events to that calendar from the background thread. But when you get to this point it probably makes sense to move more functionality out of the background task and put that on the server too.