Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ScheduledTileNotification class

Defines the visual content and timing for a single, non-recurring scheduled update to a tile.

Syntax


var scheduledTileNotification = new Windows.UI.Notifications.ScheduledTileNotification();

Attributes

[Threading(MTA)]
[Version(0x06020000)]

Members

The ScheduledTileNotification class has these types of members:

Constructors

The ScheduledTileNotification class has these constructors.

ConstructorDescription
ScheduledTileNotification Creates and initializes a new instance of the ScheduledTileNotification object for use with a TileUpdater.

 

Properties

The ScheduledTileNotification class has these properties.

PropertyAccess typeDescription

Content

Read-onlyGets the XML description of the content of the scheduled tile update.

DeliveryTime

Read-onlyGets the time at which the tile is scheduled to be updated.

ExpirationTime

Read/writeGets or sets the time after which the tile notification should no longer be shown.

Id

Read/writeGets or sets the unique ID that is used to identify the scheduled tile in the schedule.

Tag

Read/writeGets or sets a string that Windows can use to prevent duplicate notification content from appearing in the queue.

 

Examples

The following example shows a tile scheduled to display in one hour.



var Notifications = Windows.UI.Notifications;
var currentTime = new Date();
var seconds = 60;
var dueTime = new Date(currentTime.getTime() + seconds * 60 * 1000);
var idNumber = Math.floor(Math.random() * 100000000);  // Generates a unique ID number for the notification.

var tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileWide310x150Text09);

// Set up the wide tile text.
var tileTextAttributes = tileXml.getElementsByTagName("text");
tileTextAttributes[0].appendChild(tileXml.createTextNode("This is a scheduled notification"));
tileTextAttributes[1].appendChild(tileXml.createTextNode("Received: " + dueTime.toLocaleTimeString()));

// Set up the medium tile text.
var squareTileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileSquare150x150Text04);
var squareTileTextAttributes = squareTileXml.getElementsByTagName("text");
squareTileTextAttributes[0].appendChild(squareTileXml.createTextNode("This is a scheduled notification"));

// Include the medium tile in the notification.
var node = tileXml.importNode(squareTileXml.getElementsByTagName("binding").item(0), true);
tileXml.getElementsByTagName("visual").item(0).appendChild(node);

// Create the notification object.
var futureTile = new Notifications.ScheduledTileNotification(tileXml, dueTime);
futureTile.id = "Tile" + idNumber;

// Add to the schedule.
Notifications.TileUpdateManager.createTileUpdaterForApplication().addToSchedule(futureTile);

Requirements (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Notifications
Windows::UI::Notifications [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (operating system)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.UI.Notifications
Windows::UI::Notifications [C++]

Metadata

Windows.winmd

See also

Object
ScheduledTileNotification
Scheduled notifications sample
Tile schema
Guidelines and checklist for scheduled notifications

 

 

Show:
© 2015 Microsoft