locked
Badge notifications is not appearing on icon RRS feed

  • Question

  • I am using this piece of code to show badge count in my uwp app (Windows specification version - 1903)

    Windows.Data.Xml.Dom.XmlDocument badgeXml = BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeGlyph);
    Windows.Data.Xml.Dom.XmlElement badgeElement = badgeXml.SelectSingleNode("/badge") as Windows.Data.Xml.Dom.XmlElement;
    badgeElement.SetAttribute("value", ObjFactory.Instance.CreateRuntimeData().BadgeMessageCount.ToString());
    BadgeNotification badge = new BadgeNotification(badgeXml);
    BadgeUpdater badgeUpdater = BadgeUpdateManager.CreateBadgeUpdaterForApplication();
    badgeUpdater.Update(badge);

    This code initially shows badge count properly but sometime it disappear suddenly most of the time after exiting the application.

    So is there any thing changed in code because code run properly but doesn't show badge count or is there any issue at system level? 

    Friday, July 31, 2020 1:04 PM

All replies

  • Hi,

    Maybe you could check and update the badge in the EnteredBackground Event to make sure the badge is not missing.

    Have you tried the official sample Notifications? Does it have the same issue?

    By the way, questions about developing is not supported in the current forum. 

    Best regards,

    Roy


    "Developing Universal Windows apps" forum will be migrating to a new home on Microsoft Q&A (Preview)!
    We invite you to post new questions in the "Developing Universal Windows apps" forum’s new home on Microsoft Q&A (Preview)!
    For more information, please refer to the sticky post.

    Monday, August 3, 2020 3:10 AM