tile template catalog badge catalog toast template catalog toast audio options catalog.

Download Report

Transcript tile template catalog badge catalog toast template catalog toast audio options catalog.

tile template catalog badge catalog toast
template catalog
toast audio options catalog
XML badge update schema
<?xml version = "1.0" encoding = "utf-8" ?>
<badge value = "1-99" | "none" | "activity" | "alert" | "available" | "away" | ...
version? = "integer" />
XML tile update schema
<?xml version="1.0" encoding="utf-8" ?>
<tile>
<visual version? = "integer" lang? = "string" baseUri? = "anyURI"
branding? = "string" addImageQuery? = "boolean" >
<!-- One or more binding elements: *always place large tiles last* -->
<binding template = "TileSquare150x150Image" | "TileSquare150x150Block" | ...
fallback? = "TileSquareImage" | "TileSquareBlock" | ...
contentId = "string" lang? = "string" baseUri? = "anyURI"
branding? = "string" addImageQuery? = "boolean" >
<!-- Some combination of image and text. id's used to de-dupe updates -->
<image id = "integer" src = "string"
alt? = "string" addImageQuery? = "boolean" />
<text id = "integer" lang? = "string" />
</binding>
</visual>
</tile>
XML toast notification schema
<?xml version="1.0" encoding="utf-8" ?>
<toast launch? = "string" duration? = "long" | "short" >
<visual version? = "integer" lang? = "string"
baseUri? = "anyURI" branding? = "string" addImageQuery? = "boolean" >
<binding template = "ToastImageAndText01" | "ToastImageAndText02" | ...=""
fallback? = "string" lang? = "string" baseUri? = "anyURI"
branding? = "string" 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
Windows.UI.Notifications
Windows.UI.Notifications
<m2:TileUpdate Recurrence="halfHour"
UriTemplate="http://my.service.com/tileupdates.aspx?lang={language}" />
PushNotificationChannel.PushNotificationReceived
PushNotificationTrigger
http://bit.ly/YgviPT
Renewing WNS channels (register task, C#)
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();
Renewing WNS channels (task, C#)
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();
}
}
}
Renewing WNS channels (task, JavaScript)
// 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);
})();
Receiving raw notification (register task, C#)
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();
Receiving raw notification (task, C#)
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;
}
}
}
Alive with Activity: 3-part series on the Windows
Developer Blog
Tiles and Notifications section
Working with tiles, badges, and toast notifications
Windows 8.1 Samples
Programming Windows 8 Apps in HTML, CSS, and JavaScript
http://aka.ms/SecondEdition/FirstPreview
http://dev.windows.com
http://design.windows.com/
Windows 8.1 Samples
http://channel9.msdn.com/Windows