Creates and initializes a new instance of the TileUpdater, which enables you to change the appearance of a secondary tile. The tile can belong to the calling app or any other app in the same package.
Syntax
var tileUpdater = Windows.UI.Notifications.TileUpdateManager.createTileUpdaterForSecondaryTile(tileId);
Parameters
- tileId
-
Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]
A unique ID for the tile.
Return value
Type: TileUpdater
The object you will use to send updates to the tile identified by tileID.
Examples
The following example demonstrates how to send a notification to a secondary tile.
var Notifications = Windows.UI.Notifications; // Define the notification content. var tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileWideText04); var tileTextAttributes = tileXml.getElementsByTagName("text"); tileTextAttributes[0].appendChild(tileXml.createTextNode("Sent to a secondary tile!")); // Provide a square version of the notification as well, remembering that the user has control // over whether the tile is displaying as wide or square. var squareTileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileSquareText04); var squareTileTextAttributes = squareTileXml.getElementsByTagName("text"); squareTileTextAttributes[0].appendChild(squareTileXml.createTextNode("Sent to a secondary tile!")); // Add the square tile to the notification. var node = tileXml.importNode(squareTileXml.getElementsByTagName("binding").item(0), true); tileXml.getElementsByTagName("visual").item(0).appendChild(node); // Create the notification based on the XML content. var tileNotification = new Notifications.TileNotification(tileXml); // Create a secondary tile updater and pass it the secondary tileId var tileUpdater = Notifications.TileUpdateManager.createTileUpdaterForSecondaryTile("SecondaryTile.Dynamic"); // Send the notification to the secondary tile. tileUpdater.update(tileNotification);
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
See also
- TileUpdateManager
- App tiles and badges sample
- Quickstart: Sending a tile update
- Tile and tile notification overview
- The tile template catalog
- Guidelines and checklist for tiles
- How to schedule a tile notification
- How to set up periodic notifications for tiles
- Tiles XML schema
Build date: 12/4/2012