BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile | createBadgeUpdaterForSecondaryTile method

Applies to Windows and Windows Phone

Creates and initializes a new instance of the BadgeUpdater, which enables you to change the appearance or content of a badge on a secondary tile. The tile can belong to the calling app or any other app in the same package.

Syntax


var badgeUpdater = Windows.UI.Notifications.BadgeUpdateManager.createBadgeUpdaterForSecondaryTile(tileId);

Parameters

tileId

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The unique ID of the tile.

Return value

Type: BadgeUpdater

The object you will use to send badge updates to the tile identified by tileID.

Examples

The following example demonstrates how to send a numeric badge notification to a secondary tile with an ID of "SecondaryTile.Dynamic".



var Notifications = Windows.UI.Notifications;

// Define the badge content
var badgeNotification = Notifications.BadgeUpdateManager.getTemplateContent(Notifications.BadgeTemplateType.badgeNumber);
var badgeAttributes = badgeNotification.getElementsByTagName("badge");
badgeAttributes[0].setAttribute("value", "6");

// Create the notification based on the XML content.
var badge = new Notifications.BadgeNotification(badgeNotification);

// Create a secondary tile updater, passing it the ID of the tile.
Notifications.BadgeUpdateManager.createBadgeUpdaterForSecondaryTile("SecondaryTile.Dynamic");

// Send the notification to the secondary tile.
tileUpdater.update(tileNotification);

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

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

BadgeUpdateManager
App tiles and badges sample
Guidelines and checklist for tiles and badges
How to clear a badge
How to send a glyph or numeric badge in a local notification
How to set up periodic notifications for badges
How to update a badge through push notifications
Badge XML schema
Badge overview

 

 

Show:
© 2014 Microsoft