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.

BadgeUpdater.Update | update method

Applies a change to the badge's glyph or number.

Syntax


badgeUpdater.update(notification);

Parameters

notification

Type: BadgeNotification

The object that supplies the new XML definition for the badge.

Examples

The following example shows the use of Update to send a numeric badge update to the calling app's tile.



function sendBadgeNotification() {
    var Notifications = Windows.UI.Notifications;
    var badgeXml;
    var badgeAttributes;

    // Get an XML DOM version of a specific template by using getTemplateContent.
    badgeXml = Notifications.BadgeUpdateManager.getTemplateContent(Notifications.BadgeTemplateType.badgeNumber);
    badgeAttributes = badgeXml.getElementsByTagName("badge");
    badgeAttributes[0].setAttribute("value", "7");

    // Create a badge notification from the XML content.
    var badgeNotification = new Notifications.BadgeNotification(badgeXml);

    // Send the badge notification to the app's tile.
    Notifications.BadgeUpdateManager.createBadgeUpdaterForApplication().update(badgeNotification);
}

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

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

BadgeUpdater
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:
© 2015 Microsoft