Reputation: 27632
As mentioned here:
It seems that a background task will only run using a TimeTrigger if the user has placed your app on the lock screen
.
So, how can I create a Calendar
like app without background task? I mean an app which:
Upvotes: 1
Views: 412
Reputation: 45127
You can schedule periodic updates of an application's tile without being on the start screen. See this article for Notification Delivery methods. Then, once the app is launched, you could update the calendar in general.
Upvotes: 1
Reputation: 5633
You should create a maintenance trigger. These triggers will only fire once every two hours and will only fire if the machine is on AC power. When your trigger runs, you could look for upcoming appointments and create scheduled toast notifications.
var scheduledToast = new Windows.UI.Notifications.ScheduledToastNotification(toastXml, startTime);
You could update the tile as well with a ScheduledTileNotifcation() call. Unfortunately, I don't think there is a way to remove a notification so if the user deletes an appointment prior to the scheduled notification, I don't think you can remove it. I'm looking deeper into that and will comment here if I find an answer.
However, I would think for a calendar app you would want it to use a TimeTrigger and be placed on the lock screen since I would want to receive appointment reminders at any time and regardless of being plugged in or not.
Is there a reason you do not want to use the TimeTrigger?
Upvotes: 2