Skip to content

Commit 83fd4af

Browse files
authored
Merge pull request #6566 from MicrosoftDocs/drewbat/app-notifications-wasdk-migration-v2
Update app notifications docs: prioritize WinAppSDK, remove Community Toolkit
2 parents 43ce55d + 830ab54 commit 83fd4af

57 files changed

Lines changed: 3191 additions & 4571 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.openpublishing.redirection.json

Lines changed: 129 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9587,12 +9587,12 @@
95879587
},
95889588
{
95899589
"source_path": "hub/apps/design/shell/tiles-and-notifications/custom-audio-on-toasts.md",
9590-
"redirect_url": "../../../develop/notifications/app-notifications/custom-audio-on-toasts",
9590+
"redirect_url": "../../../develop/notifications/app-notifications/app-notifications-custom-audio",
95919591
"redirect_document_id": false
95929592
},
95939593
{
95949594
"source_path": "hub/apps/design/shell/tiles-and-notifications/custom-timestamps-on-toasts.md",
9595-
"redirect_url": "../../../develop/notifications/app-notifications/custom-timestamps-on-toasts",
9595+
"redirect_url": "../../../develop/notifications/app-notifications/app-notifications-custom-timestamps",
95969596
"redirect_document_id": false
95979597
},
95989598
{
@@ -9612,7 +9612,7 @@
96129612
},
96139613
{
96149614
"source_path": "hub/apps/design/shell/tiles-and-notifications/scheduled-toast.md",
9615-
"redirect_url": "../../../develop/notifications/app-notifications/scheduled-toast",
9615+
"redirect_url": "../../../develop/notifications/app-notifications/app-notifications-scheduled",
96169616
"redirect_document_id": false
96179617
},
96189618
{
@@ -9637,7 +9637,7 @@
96379637
},
96389638
{
96399639
"source_path": "hub/apps/design/shell/tiles-and-notifications/toast-collections.md",
9640-
"redirect_url": "../../../develop/notifications/app-notifications/toast-collections",
9640+
"redirect_url": "../../../develop/notifications/app-notifications/app-notifications-collections",
96419641
"redirect_document_id": false
96429642
},
96439643
{
@@ -9647,7 +9647,7 @@
96479647
},
96489648
{
96499649
"source_path": "hub/apps/design/shell/tiles-and-notifications/toast-headers.md",
9650-
"redirect_url": "../../../develop/notifications/app-notifications/toast-headers",
9650+
"redirect_url": "../../../develop/notifications/app-notifications/app-notifications-headers",
96519651
"redirect_document_id": false
96529652
},
96539653
{
@@ -9657,22 +9657,142 @@
96579657
},
96589658
{
96599659
"source_path": "hub/apps/design/shell/tiles-and-notifications/toast-pending-update.md",
9660-
"redirect_url": "../../../develop/notifications/app-notifications/toast-pending-update",
9660+
"redirect_url": "../../../develop/notifications/app-notifications/app-notifications-pending-update",
96619661
"redirect_document_id": false
96629662
},
96639663
{
96649664
"source_path": "hub/apps/design/shell/tiles-and-notifications/toast-progress-bar.md",
9665-
"redirect_url": "../../../develop/notifications/app-notifications/toast-progress-bar",
9665+
"redirect_url": "../../../develop/notifications/app-notifications/app-notifications-progress-bar",
96669666
"redirect_document_id": false
96679667
},
96689668
{
96699669
"source_path": "hub/apps/design/shell/tiles-and-notifications/toast-schema.md",
9670-
"redirect_url": "../../../develop/notifications/app-notifications/toast-schema",
9670+
"redirect_url": "../../../develop/notifications/app-notifications/app-notifications-schema",
96719671
"redirect_document_id": false
96729672
},
96739673
{
96749674
"source_path": "hub/apps/design/shell/tiles-and-notifications/toast-ux-guidance.md",
9675-
"redirect_url": "../../../develop/notifications/app-notifications/toast-ux-guidance",
9675+
"redirect_url": "../../../develop/notifications/app-notifications/app-notifications-ux-guidance",
9676+
"redirect_document_id": false
9677+
},
9678+
{
9679+
"source_path": "hub/apps/develop/notifications/app-notifications/custom-audio-on-notifications.md",
9680+
"redirect_url": "app-notifications-custom-audio",
9681+
"redirect_document_id": false
9682+
},
9683+
{
9684+
"source_path": "hub/apps/develop/notifications/app-notifications/custom-timestamps-on-notifications.md",
9685+
"redirect_url": "app-notifications-custom-timestamps",
9686+
"redirect_document_id": false
9687+
},
9688+
{
9689+
"source_path": "hub/apps/develop/notifications/app-notifications/notification-collections.md",
9690+
"redirect_url": "app-notifications-collections",
9691+
"redirect_document_id": false
9692+
},
9693+
{
9694+
"source_path": "hub/apps/develop/notifications/app-notifications/notification-headers.md",
9695+
"redirect_url": "app-notifications-headers",
9696+
"redirect_document_id": false
9697+
},
9698+
{
9699+
"source_path": "hub/apps/develop/notifications/app-notifications/notification-pending-update.md",
9700+
"redirect_url": "app-notifications-pending-update",
9701+
"redirect_document_id": false
9702+
},
9703+
{
9704+
"source_path": "hub/apps/develop/notifications/app-notifications/notification-progress-bar.md",
9705+
"redirect_url": "app-notifications-progress-bar",
9706+
"redirect_document_id": false
9707+
},
9708+
{
9709+
"source_path": "hub/apps/develop/notifications/app-notifications/notification-schema.md",
9710+
"redirect_url": "app-notifications-schema",
9711+
"redirect_document_id": false
9712+
},
9713+
{
9714+
"source_path": "hub/apps/develop/notifications/app-notifications/scheduled-notification.md",
9715+
"redirect_url": "app-notifications-scheduled",
9716+
"redirect_document_id": false
9717+
},
9718+
{
9719+
"source_path": "hub/apps/develop/notifications/app-notifications/toast-ux-guidance.md",
9720+
"redirect_url": "app-notifications-ux-guidance",
9721+
"redirect_document_id": false
9722+
},
9723+
{
9724+
"source_path": "hub/apps/develop/notifications/app-notifications/app-notifications-uwp.md",
9725+
"redirect_url": "/uwp/develop/app-notifications-uwp",
9726+
"redirect_document_id": false
9727+
},
9728+
{
9729+
"source_path": "hub/apps/develop/notifications/app-notifications/adaptive-interactive-toasts.md",
9730+
"redirect_url": "app-notifications-content",
9731+
"redirect_document_id": false
9732+
},
9733+
{
9734+
"source_path": "hub/apps/develop/notifications/app-notifications/send-local-toast.md",
9735+
"redirect_url": "app-notifications-quickstart",
9736+
"redirect_document_id": false
9737+
},
9738+
{
9739+
"source_path": "hub/apps/develop/notifications/app-notifications/send-local-toast-cpp-uwp.md",
9740+
"redirect_url": "app-notifications-quickstart",
9741+
"redirect_document_id": false
9742+
},
9743+
{
9744+
"source_path": "hub/apps/develop/notifications/app-notifications/send-local-toast-desktop-cpp-wrl.md",
9745+
"redirect_url": "app-notifications-quickstart",
9746+
"redirect_document_id": false
9747+
},
9748+
{
9749+
"source_path": "hub/apps/develop/notifications/app-notifications/send-local-toast-other-apps.md",
9750+
"redirect_url": "app-notifications-other-frameworks",
9751+
"redirect_document_id": false
9752+
},
9753+
{
9754+
"source_path": "hub/apps/develop/notifications/app-notifications/toast-desktop-apps.md",
9755+
"redirect_url": "app-notifications-quickstart",
9756+
"redirect_document_id": false
9757+
},
9758+
{
9759+
"source_path": "hub/apps/develop/notifications/app-notifications/toast-schema.md",
9760+
"redirect_url": "app-notifications-schema",
9761+
"redirect_document_id": false
9762+
},
9763+
{
9764+
"source_path": "hub/apps/develop/notifications/app-notifications/scheduled-toast.md",
9765+
"redirect_url": "app-notifications-scheduled",
9766+
"redirect_document_id": false
9767+
},
9768+
{
9769+
"source_path": "hub/apps/develop/notifications/app-notifications/toast-collections.md",
9770+
"redirect_url": "app-notifications-collections",
9771+
"redirect_document_id": false
9772+
},
9773+
{
9774+
"source_path": "hub/apps/develop/notifications/app-notifications/toast-headers.md",
9775+
"redirect_url": "app-notifications-headers",
9776+
"redirect_document_id": false
9777+
},
9778+
{
9779+
"source_path": "hub/apps/develop/notifications/app-notifications/toast-pending-update.md",
9780+
"redirect_url": "app-notifications-pending-update",
9781+
"redirect_document_id": false
9782+
},
9783+
{
9784+
"source_path": "hub/apps/develop/notifications/app-notifications/toast-progress-bar.md",
9785+
"redirect_url": "app-notifications-progress-bar",
9786+
"redirect_document_id": false
9787+
},
9788+
{
9789+
"source_path": "hub/apps/develop/notifications/app-notifications/custom-audio-on-toasts.md",
9790+
"redirect_url": "app-notifications-custom-audio",
9791+
"redirect_document_id": false
9792+
},
9793+
{
9794+
"source_path": "hub/apps/develop/notifications/app-notifications/custom-timestamps-on-toasts.md",
9795+
"redirect_url": "app-notifications-custom-timestamps",
96769796
"redirect_document_id": false
96779797
},
96789798
{

hub/apps/desktop/modernize/get-activation-info-for-packaged-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ You can use the [AppInstance.GetActivatedEventArgs](/uwp/api/windows.application
6161
|-------------------|-----------------|-----------------------|
6262
| [ShareTargetActivatedEventArgs](/uwp/api/windows.applicationmodel.activation.sharetargetactivatedeventargs) | [uap:ShareTarget](/uwp/schemas/appxpackage/uapmanifestschema/element-uap-sharetarget) | [Integrate packaged apps with Windows Share](../../develop/windows-integration/integrate-sharesheet-packaged.md) |
6363
| [ProtocolActivatedEventArgs](/uwp/api/windows.applicationmodel.activation.protocolactivatedeventargs) | [uap:Protocol](/uwp/schemas/appxpackage/uapmanifestschema/element-uap-protocol) | [Start your application by using a protocol](./desktop-to-uwp-extensions.md#start-your-application-by-using-a-protocol) |
64-
| [ToastNotificationActivatedEventArgs](/uwp/api/windows.applicationmodel.activation.toastnotificationactivatedeventargs) | desktop:ToastNotificationActivation | [Toast notifications from desktop apps](/windows/uwp/design/shell/tiles-and-notifications/toast-desktop-apps). |
64+
| [ToastNotificationActivatedEventArgs](/uwp/api/windows.applicationmodel.activation.toastnotificationactivatedeventargs) | desktop:ToastNotificationActivation | [App notifications quickstart](/windows/apps/develop/notifications/app-notifications/app-notifications-quickstart). |
6565
| [StartupTaskActivatedEventArgs](/uwp/api/windows.applicationmodel.activation.startuptaskactivatedeventargs) | desktop:StartupTask | [Start an executable file when users log into Windows](./desktop-to-uwp-extensions.md#start-an-executable-file-when-users-log-into-windows) |
6666
| [FileActivatedEventArgs](/uwp/api/windows.applicationmodel.activation.fileactivatedeventargs) | [uap:FileTypeAssociation](/uwp/schemas/appxpackage/uapmanifestschema/element-uap-filetypeassociation) | [Associate your packaged application with a set of file types](./desktop-to-uwp-extensions.md#associate-your-packaged-application-with-a-set-of-file-types) |
6767
| [VoiceCommandActivatedEventArgs](/uwp/api/windows.applicationmodel.activation.voicecommandactivatedeventargs) | None | [Activate a foreground app with voice commands through Cortana](../../design/input/cortana-launch-a-foreground-app-with-voice-commands.md) |
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
description: Explore additional app notification features in the Windows App SDK, including removing notifications, scheduling, custom audio, progress bars, and organizing with collections and headers.
3+
title: Additional App Notification Features
4+
label: Additional app notification features
5+
template: detail.hbs
6+
ms.date: 07/28/2025
7+
ms.topic: article
8+
keywords: windows 11, windows app sdk, winappsdk, notification, features
9+
ms.localizationpriority: medium
10+
---
11+
# Additional app notification features
12+
13+
The articles in this section describe app notifications features such as how to manage notification lifecycle, customize appearance and behavior, and organize notifications in Notification Center. To get started using app notifications in a Windows app, see [Quickstart: App notifications](app-notifications-quickstart.md).
14+
15+
| Feature | Description |
16+
|---------|-------------|
17+
| [Remove notifications](manage-app-notifications.md) | Tag, group, remove, and set expiration on notifications. |
18+
| [Schedule notifications](app-notifications-scheduled.md) | Schedule a notification to appear at a future time. |
19+
| [Custom audio](app-notifications-custom-audio.md) | Use your app's own sound effects for notifications. |
20+
| [Progress bar](app-notifications-progress-bar.md) | Display and update a progress bar inside a notification. |
21+
| [Pending update](app-notifications-pending-update.md) | Create multi-step interactions with pending update activation. |
22+
| [Custom timestamps](app-notifications-custom-timestamps.md) | Override the system timestamp with a custom time. |
23+
| [Collections](app-notifications-collections.md) | Organize notifications into collections in Notification Center. |
24+
| [Headers](app-notifications-headers.md) | Group notifications under headers in Notification Center. |
25+
| [Notification Listener](notification-listener.md) | Access and monitor all notifications on the device. |
26+
27+
## See also
28+
29+
- [App notifications overview](index.md)
30+
- [Quickstart: App notifications](app-notifications-quickstart.md)
31+
- [App notification content](app-notifications-content.md)
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
---
2+
description: Learn how to organize app notifications by creating, updating, or removing notification collections in Notification Center.
3+
title: App notification collections
4+
label: App notification collections
5+
template: detail.hbs
6+
ms.date: 07/28/2025
7+
ms.topic: how-to
8+
keywords: windows 11, windows app sdk, winappsdk, notification, collections, collection, group notifications, grouping notifications, group, organize, Notification Center
9+
ms.localizationpriority: medium
10+
---
11+
# App notification collections
12+
13+
Use collections to organize your app's notifications in Notification Center. Collections help users locate information more easily and allow developers to better manage their notifications.
14+
15+
A messaging app, for example, can separate notifications by chat group. Each group title ("Comp Sci 160A Project Chat", "Direct Messages", "Lacrosse Team Chat") is a separate collection. Notifications are grouped as if they were from a separate app, even though they all come from the same app. For a more subtle way to organize notifications, see [App notification headers](app-notifications-headers.md).
16+
17+
![Collection Example with two different Groups of Notifications](images/toast-collection-example.png)
18+
19+
> [!NOTE]
20+
> The code examples in this article use the `Microsoft.Windows.AppNotifications` namespace to build notification content and the `Windows.UI.Notifications` namespace for collection management. These two namespaces can be used together in the same app.
21+
22+
For more information about app notifications, see [App notifications overview](index.md).
23+
24+
## Create a collection
25+
26+
When creating a collection, provide a display name and an icon, which are shown in Notification Center as part of the collection's title. Collections also require a launch argument so your app can navigate to the right location when the user clicks the collection title. Create the collection by calling [**SaveToastCollectionAsync**](/uwp/api/windows.ui.notifications.toastcollectionmanager.savetoastcollectionasync).
27+
28+
```csharp
29+
using Windows.UI.Notifications;
30+
31+
var collection = new ToastCollection(
32+
"MyToastCollection",
33+
"Work Email",
34+
"NavigateToWorkEmailInbox",
35+
new Uri("ms-appx:///Assets/workEmail.png"));
36+
37+
await ToastNotificationManager.GetDefault()
38+
.GetToastCollectionManager()
39+
.SaveToastCollectionAsync(collection);
40+
```
41+
42+
## Send a notification to a collection
43+
44+
Use [**AppNotificationBuilder**](/windows/windows-app-sdk/api/winrt/microsoft.windows.appnotifications.builder.appnotificationbuilder) to construct the notification content, then call [**GetToastNotifierForToastCollectionIdAsync**](/uwp/api/windows.ui.notifications.toastnotificationmanagerforuser.gettoastnotifierfortoastcollectionidasync) to get a notifier scoped to the collection.
45+
46+
```csharp
47+
using Microsoft.Windows.AppNotifications.Builder;
48+
using Windows.UI.Notifications;
49+
using Windows.Data.Xml.Dom;
50+
51+
// Build notification content with Windows App SDK
52+
var payload = new AppNotificationBuilder()
53+
.AddText("Adam sent a message to the group")
54+
.BuildNotification()
55+
.Payload;
56+
57+
// Deliver to a collection using the WinRT API
58+
var doc = new XmlDocument();
59+
doc.LoadXml(payload);
60+
var toast = new ToastNotification(doc);
61+
62+
var notifier = await ToastNotificationManager.GetDefault()
63+
.GetToastNotifierForToastCollectionIdAsync("MyToastCollection");
64+
notifier.Show(toast);
65+
```
66+
67+
## List all collections
68+
69+
Retrieve all collections created for your app by calling [**FindAllToastCollectionsAsync**](/uwp/api/windows.ui.notifications.toastcollectionmanager.findalltoastcollectionsasync).
70+
71+
```csharp
72+
var collectionManager = ToastNotificationManager.GetDefault().GetToastCollectionManager();
73+
var collections = await collectionManager.FindAllToastCollectionsAsync();
74+
```
75+
76+
## Update a collection
77+
78+
Update a collection by creating a new [**ToastCollection**](/uwp/api/windows.ui.notifications.toastcollection) instance with the same ID and calling [**SaveToastCollectionAsync**](/uwp/api/windows.ui.notifications.toastcollectionmanager.savetoastcollectionasync).
79+
80+
```csharp
81+
var collectionManager = ToastNotificationManager.GetDefault().GetToastCollectionManager();
82+
83+
var updatedCollection = new ToastCollection(
84+
"MyToastCollection",
85+
"Updated Display Name",
86+
"UpdatedLaunchArgs",
87+
new Uri("ms-appx:///Assets/updatedPicture.png"));
88+
89+
await collectionManager.SaveToastCollectionAsync(updatedCollection);
90+
```
91+
92+
## Remove a collection
93+
94+
Remove a collection by calling [**RemoveToastCollectionAsync**](/uwp/api/windows.ui.notifications.toastcollectionmanager.removetoastcollectionasync) with the collection ID. Any notifications in the collection are also removed from Notification Center.
95+
96+
```csharp
97+
var collectionManager = ToastNotificationManager.GetDefault().GetToastCollectionManager();
98+
await collectionManager.RemoveToastCollectionAsync("MyToastCollection");
99+
```
100+
101+
## Remove notifications within a collection
102+
103+
Use the **Tag** and **Group** properties to identify and remove individual notifications within a collection by calling [**Remove**](/uwp/api/windows.ui.notifications.toastnotificationhistory.remove), or clear all notifications at once with [**Clear**](/uwp/api/windows.ui.notifications.toastnotificationhistory.clear).
104+
105+
```csharp
106+
var collectionHistory = await ToastNotificationManager.GetDefault()
107+
.GetHistoryForToastCollectionAsync("MyToastCollection");
108+
109+
// Remove a specific notification
110+
collectionHistory.Remove(tag, group);
111+
112+
// Or clear all notifications in the collection
113+
collectionHistory.Clear();
114+
```
115+
116+
## See also
117+
118+
- [App notifications overview](index.md)

0 commit comments

Comments
 (0)