Download presentation
Presentation is loading. Please wait.
5
Local, scheduled, periodic and push updates
11
<badge value = "1-99" | "none" | "activity" | "alert" | "available" | "away" |... version? = "integer" />
12
<visual version? = "integer" lang? = "string" baseUri? = "anyURI" branding? = "none" addImageQuery? = "boolean" > <binding template = "TileSquareImage" | "TileSquareBlock" |... fallback? = "string" lang? = "string" baseUri? = "anyURI" branding? = "none" addImageQuery? = "boolean" > <image id = "integer" src = "string" alt? = "string" addImageQuery? = "boolean" />
13
<visual version? = "integer" lang? = "string" baseUri? = "anyURI" branding? = "none" addImageQuery? = "boolean" > <binding template = "ToastImageAndText01" | "ToastImageAndText02" |...="" fallback? = "string" lang? = "string" baseUri? = "anyURI" branding? = "none" addImageQuery? = "boolean" > <audio src? = "ms-winsoundevent:Notification.Default" |... loop? = "boolean" silent? = "boolean" />
16
System process
17
System process 30m to 24h frequency per service URI HTTP Request
19
Send channel to web service WNS Send update Push updates to client (tile, badge, toast, raw)
22
Building a Cloud Service with Window Azure
24
using Windows.ApplicationModel.Background; BackgroundTaskBuilder taskBuilder = new BackgroundTaskBuilder(); MaintenanceTrigger trigger = new MaintenanceTrigger( 10 * 24 * 60, false); //10 * 24 * 60 == 10 days taskBuilder.SetTrigger(trigger); //In JavaScript, taskEntryPoint is the path of a.js file taskBuilder.TaskEntryPoint = "PushNotificationsHelper.MaintenanceTask"; taskBuilder.Name = "UpdateChannels"; SystemCondition internetCondition = new SystemCondition( SystemConditionType.InternetAvailable); taskBuilder.AddCondition(internetCondition); taskBuilder.Register();
25
using System; using System.Threading.Tasks; using Windows.ApplicationModel.Background; namespace PushNotificationsHelper { public sealed class MaintenanceTask : IBackgroundTask { public void Run(IBackgroundTaskInstance taskInstance) { // This is a helper function to renew WNS channels. // Important here to not block the UI thread. Notifier notifier = new Notifier(); notifier.RenewAllAsync(false).AsTask().Wait(); }
26
// This code runs as a web worker (function () { // Import the Notifier helper object importScripts("//Microsoft.WinJS.1.0/js/base.js"); importScripts("notifications.js"); var closeFunction = function () { close(); // This is worker.close }; var notifier = new SampleNotifications.Notifier(); notifier.renewAllAsync().done(closeFunction, closeFunction); })();
27
using Windows.ApplicationModel.Background; using Windows.Networking.PushNotifications; BackgroundTaskBuilder taskBuilder = new BackgroundTaskBuilder(); PushNotificationTrigger trigger = new PushNotificationTrigger(); taskBuilder.SetTrigger(trigger); taskBuilder.TaskEntryPoint = "BackgroundTasks.RawNotification"; taskBuilder.Name = "ReceiveRawNotification"; taskBuilder.Register();
28
using System.Diagnostics; using Windows.ApplicationModel.Background; using Windows.Networking.PushNotifications; using Windows.Storage; namespace BackgroundTasks { public sealed class RawNotification : IBackgroundTask { public void Run(IBackgroundTaskInstance taskInstance) { // Get the background task details ApplicationDataContainer settings = ApplicationData.Current.LocalSettings; // Store the content received from the notification so it // can be retrieved from the UI. RawNotification notification = (RawNotification)taskInstance.TriggerDetails; settings.Values[taskName] = notification.Content; }
30
Personalized, real-time status Missed toast notifications
31
Avoid high frequency, streaming updates Do not update to explicitly replace ‘old content’ Do not depend on tile ordering
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.