The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
ToastNotification.SuppressPopup varies behaviour of showing toast messages RRS feed

  • Question

  • Hi there,

    while working with toast notifications and the action center, I faced a strange behavior with the Action Center on Windows 10 TH2:

    When I push a toast notification with Tag=a, Group=a and toastNotification.SuppressPopup=true, the previous toast notification (with same group/tag) is not replaced in the action center. In addition, when I try the same thing again with toastNotification.SuppressPopup=false, afterwards, it generates a new notification without replacing the old one (even when the tag/group-Ids are the same.

    Let me demonstrate this behaviour with the following pseudo code:

    // helper
    public voidShowToast(string tag, string group, string text, bool suppressPopup)
    {
      var toast = GetFromTemplate(text,...);
      toast.Tag = tag;
      toast.Group = group;
      toast.SuppressPopup = suppressPopup;
      ToastNotificationManager.CreateToastNotifier().Show(toast);
    }
    
    // main
    ShowToast("a", "a", "A", false);
    ShowToast("b", "b", "B", false);
    ShowToast("a", "a", "AA", false);
    ShowToast("a", "a", "AAA", true);
    ShowToast("a", "a", "AAAA", false);

    In Windows 10 Mobile Emulator (10240), it works fine and the behavior is:

    1. A new toast notification is pushed to the action center with text "A"
    2. A new toast notification is pushed to the action center with text "B"
    3. The first toast notification is replaced in the action center: "A" --> "AA"
    4. The first toast notification is replaced in the action center: "AA" --> "AAA"
    5. The first toast notification is replaced in the action center: "AAA" --> "AAAA"

    But in Windows 10 Desktop (TH2 update) the behaves weird (see 4. and 5.):

    1. A new toast notification is pushed to the action center with text "A"
    2. A new toast notification is pushed to the action center with text "B"
    3. The first toast notification is replaced in the action center: "A" --> "AA"
    4. The first toast notification is not updated at all!
    5. The third toast notification is created with text "AAAA", even there is already the first toast with the same Tag/Group ID

    Can somebody explain this new behavior? Or is it just a new bug that was introduced in the TH2 update?

    Thanks,

    Benjamin

    Tuesday, November 17, 2015 11:12 AM

Answers

  • Hey Benjamin,

    We confirmed that this is a bug in TH2. We have fixed this for RS1, but currently don't have any plans to push this fix back to TH2.

    Impact of bug: When replacing a toast using tag/group, if you use SuppressPopup on the new toast, the toast will fail to be updated until you reboot the computer. And if you pop a subsequent toast without SuppressPopup, it will appear as a new toast due to the previous broken SuppressPopup toast.

    Workaround: You might be able to delete the current notification and then pop the new notification.

    How to avoid this problem: If you don't use SuppressPopup when replacing your toast notifications, you'll never run into this problem. Obviously some scenarios require it (use the workaround in those cases), but I want to make the impact of this bug clear.

    And to respond to your question about the SuppressPopup documentation saying WP 8.1 only: Thanks for pointing that out, we're working on getting that documentation updated. SuppressPopup is supported on everything but Windows 8/8.1. UWP (desktop and mobile) fully supports SuppressPopup.


    Wednesday, November 18, 2015 12:51 AM

All replies

  • I just found the following comment about ToastNotification.SuppressPopup in the MSDN documentation:

    ---
    Gets or sets whether a toast's pop-up UI is displayed on the Windows Phone 8.1 screen.

    Note  Do not set this property to true in a toast sent to a non-Windows Phone 8.1 device. Doing so will cause a compiler error or a dropped notification.
    ---

    Does this mean we should not use this property in UWP apps?

    Tuesday, November 17, 2015 11:41 AM
  • Hey Benjamin, thanks for reporting this, we are investigating this issue!

    I'll report back when we have more information. This looks like a bug. Expected behavior is that tag/group replaces the existing notification.

    Tuesday, November 17, 2015 11:25 PM
  • Hey Benjamin,

    We confirmed that this is a bug in TH2. We have fixed this for RS1, but currently don't have any plans to push this fix back to TH2.

    Impact of bug: When replacing a toast using tag/group, if you use SuppressPopup on the new toast, the toast will fail to be updated until you reboot the computer. And if you pop a subsequent toast without SuppressPopup, it will appear as a new toast due to the previous broken SuppressPopup toast.

    Workaround: You might be able to delete the current notification and then pop the new notification.

    How to avoid this problem: If you don't use SuppressPopup when replacing your toast notifications, you'll never run into this problem. Obviously some scenarios require it (use the workaround in those cases), but I want to make the impact of this bug clear.

    And to respond to your question about the SuppressPopup documentation saying WP 8.1 only: Thanks for pointing that out, we're working on getting that documentation updated. SuppressPopup is supported on everything but Windows 8/8.1. UWP (desktop and mobile) fully supports SuppressPopup.


    Wednesday, November 18, 2015 12:51 AM
  • Thank very much you for your detailed answer.

    I'm looking forward to the update.

    Best regards,
    Benjamin

    Wednesday, November 18, 2015 10:41 PM
  • Could you tell us the name of your application that uses SuppressPopup and replacing toasts?

    Ultimately you should look at using the workaround (removing and then re-popping toast) since it's possible that a fix for this won't go out till RS1.

    Thursday, November 19, 2015 6:57 PM
  • Could you tell us the name of your application that uses SuppressPopup and replacing toasts?

    Ultimately you should look at using the workaround (removing and then re-popping toast) since it's possible that a fix for this won't go out till RS1.

    The app is called Action Note, which massively uses the Action Center:

    Action Note for Windows 10

    I'm using the workaround so far, but that comes to the cost of many notifications being deleted, created, deleted, created ... especially in combination with a second bug of the Action Center: Even when the sound of a notification is suppressed, the sound is played on Windows 10 Mobile, in case the Action Center is in "open" state. Hence, when I have 10 notifications and I want to update just 1 notification in the middle, I have to recreate everything, and the consequence is a series of *bling* *bling* *bling* sounds, which is more than annoying :)

    Best regards from Germany,

    Benjamin

    Sunday, December 13, 2015 10:22 AM
  • We're aware that the workaround isn't perfect, but the fix won't be there till the next release (RS1), so you'll have to keep the workaround for now unfortunately.

    Thanks,
    Andrew

    Wednesday, December 16, 2015 6:55 PM