Local, scheduled, periodic and push updates Tile template catalog badge catalog toast template catalog Toast audio options catalog.

Download Report

Transcript Local, scheduled, periodic and push updates Tile template catalog badge catalog toast template catalog Toast audio options catalog.

Local, scheduled,
periodic and push
updates
Tile template catalog badge catalog toast
template catalog
Toast audio options catalog
<?xml version="1.0" encoding="utf-8" ?>
<badge value = "1-99" | "none" | "activity" | "alert" | "available" | "away" | ...
version? = "integer" />
<?xml version="1.0" encoding="utf-8" ?>
<tile>
<visual version? = "integer" lang? = "string" baseUri? = "anyURI"
branding? = "none" addImageQuery? = "boolean" >
<!-- One or more binding elements -->
<binding template = "TileSquareImage" | "TileSquareBlock" | ...
fallback? = "string" lang? = "string" baseUri? = "anyURI"
branding? = "none" addImageQuery? = "boolean" >
<!-- Some combination of image and text -->
<image id = "integer" src = "string"
alt? = "string" addImageQuery? = "boolean" />
<text id = "integer" lang? = "string" />
</binding>
</visual>
</tile>
<?xml version="1.0" encoding="utf-8" ?>
<toast launch? = "string" duration? = "long" | "short" >
<visual version? = "integer" lang? = "string"
baseUri? = "anyURI" branding? = "none" addImageQuery? = "boolean" >
<!-- One or more bindings -->
<binding template = "ToastImageAndText01" | "ToastImageAndText02" | ...=""
fallback? = "string" lang? = "string" baseUri? = "anyURI"
branding? = "none" addImageQuery? = "boolean" >
<!-- Some number of child elements -->
<image id = "integer" src = "string" alt = "string" addImageQuery? = "boolean" />
<text id = "integer" lang? = "string" />
</binding>
</visual>
<!-- Optional audio -->
<audio src? = "ms-winsoundevent:Notification.Default" |...
loop? = "boolean" silent? = "boolean" />
</toast>
Windows.UI.StartScreen.SecondaryTiles
Secondary Tiles Sample
Windows.UI.Notifications
System process
Windows.UI.Notifications
URI
System process
30m to 24h frequency per service
HTTP Request
Windows.UI.Notifications
Send channel to web service
Send
update
Push updates
to client (tile, badge,
toast, raw)
PushNotificationChannel.PushNotificationReceived
PushNotificationTrigger
WNS
Secure service API for
channel URI registration
www.WindowsAzure.com/mobile
Persistent storage of
channel URIs
Storage for tile and
toast images
http://urbanairship.com
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();
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();
}
}
}
// 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);
})();
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();
using
using
using
using
System.Diagnostics;
Windows.ApplicationModel.Background;
Windows.Networking.PushNotifications;
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;
}
}
}
Personalized, real-time status
Missed toast notifications
not
Avoid high frequency, streaming updates
Do not update to explicitly replace ‘old content’
Do not depend on tile ordering
UX Guidelines
Working with tiles, badges, and toast
notifications
App tiles and badges sample
Secondary tiles sample
Push and periodic notifications sample
Raw notifications sample
Lock screen apps sample
Programming Windows 8 Apps in HTML, CSS, and
JavaScript
http://aka.ms/BuildSessions
http://msdn.microsoft.com/enUS/windows/apps/br229512
http://design.windows.com/
http://code.msdn.microsoft.com/windows
apps/Windows-8-Modern-Style-AppSamples
http://channel9.msdn.com/Windows
http://aka.ms/BuildSessions