You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove Community Toolkit references from includes and misc files
Update include files and remaining content files to remove
Community Toolkit notification references:
- includes/send-toast-basic-toast-intro.md: Remove toolkit API mention
- includes/send-toast-intro.md: Remove toolkit library mention
- send-local-toast-cpp-uwp.md: Remove all Builder syntax (toolkit) tabs,
leaving only XML approach; consolidate from 4 steps to 3
- toast-schema.md: Update/remove toolkit library references
Note: includes/nuget-package.md is unchanged because it is also
referenced by the WinAppSDK migration guide (out of scope for this PR).
Co-authored-by: Copilot <[email protected]>
In Windows 10 and Windows 11, your app notification content is described using an adaptive language that allows great flexibility with how your notification looks. For more information, see the [App notification content](../adaptive-interactive-toasts.md) documentation.
2
2
3
-
We'll start with a simple text-based notification. Construct the notification content and show the notification! You can use the [Windows App SDK](/windows/windows-app-sdk/api/winrt/microsoft.windows.appnotifications.builder)`AppNotificationBuilder` APIs or the [Windows Community Toolkit](https://www.nuget.org/packages/Microsoft.Toolkit.Uwp.Notifications/)`ToastContentBuilder` APIs.
3
+
We'll start with a simple text-based notification. Construct the notification content and show the notification! You can use the [Windows App SDK](/windows/windows-app-sdk/api/winrt/microsoft.windows.appnotifications.builder)`AppNotificationBuilder` APIs.
4
4
5
5
<imgalt="Simple text notification"src="../images/send-toast-01.png"width="364"/>
Copy file name to clipboardExpand all lines: hub/apps/develop/notifications/app-notifications/includes/send-toast-intro.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,4 @@ An app notification is a message that your app can construct and deliver to your
2
2
3
3
<imgsrc="../images/toast-notification.png"width="628"alt="Screenshot of an app notification"/>
4
4
5
-
This quickstart walks you through the steps to create, deliver, and display a Windows 10 or Windows 11 app notification using rich content and interactive actions. This quickstart uses local notifications, which are the simplest notification to implement. All types of apps (WinUI, WPF, WinForms, console) can send notifications with the [Windows App SDK](/windows/apps/windows-app-sdk/) or the [Windows Community Toolkit Notifications library](https://www.nuget.org/packages/Microsoft.Toolkit.Uwp.Notifications/).
5
+
This quickstart walks you through the steps to create, deliver, and display a Windows 10 or Windows 11 app notification using rich content and interactive actions. This quickstart uses local notifications, which are the simplest notification to implement. All types of apps (WinUI, WPF, WinForms, console) can send notifications with the [Windows App SDK](/windows/apps/windows-app-sdk/).
> For C++ apps using the Windows App SDK, see [Quickstart: App notifications in the Windows App SDK](app-notifications-quickstart.md) which covers the recommended approach using the `Microsoft.Windows.AppNotifications` APIs.
25
25
26
-
## Step 1: Install NuGet package
27
-
28
-
You can create app notifications with the Windows Community Toolkit (WCT)'s builder syntax OR with XML. If you prefer the latter, please skip to **Step 2** and refer to the **Without builder syntax** code examples.
If you are notusing the WCT Notifications library builder syntax, you will instead construct the XML app notification template, populate it with text and values, construct the notification, and show it.
56
-
57
-
#### [Builder syntax](#tab/builder-syntax)
58
-
59
-
```cpp
60
-
// Construct the content and show the toast!
61
-
(ref new ToastContentBuilder())
62
-
->AddArgument("action", "viewConversation")
63
-
->AddArgument("conversationId", 9813)
64
-
->AddText("Andrew sent you a picture")
65
-
->AddText("Check this out, The Enchantments in Washington!")
66
-
->Show();
67
-
```
68
-
69
-
#### [Without builder syntax](#tab/xml)
37
+
Construct the XML app notification template, populate it with text and values, construct the notification, and show it.
When the user clicks your notification (or a button on the notification with foreground activation), your app's **App.xaml.cpp****OnActivated** will be invoked.
The first step in making your notifications actionable is to add some launch args to your notification, so that your app can know what to launch when the user clicks the notification (in this case, we're including some information that later tells us we should open a conversation, and we know which specific conversation to open).
130
96
131
-
#### [Builder syntax](#tab/builder-syntax)
132
-
133
-
```cpp
134
-
// Construct the content and show the toast!
135
-
(ref new ToastContentBuilder())
136
-
137
-
// Arguments returned when user taps body of notification
You can add buttons and inputs to make your notifications interactive. Buttons can launch your foreground app, a protocol, or your background task. We'll add a reply text box, a "Like" button, and a "View" button that opens the image.
244
172
245
173
<img src="images/toast-notification.png" width="628" alt="Screenshot of an app notification with inputs and buttons"/>
Copy file name to clipboardExpand all lines: hub/apps/develop/notifications/app-notifications/toast-schema.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ms.localizationpriority: medium
15
15
16
16
The following describes all of the properties and elements within toast content.
17
17
18
-
If you would rather use raw XML instead of the [Notifications library](https://www.nuget.org/packages/Microsoft.Toolkit.Uwp.Notifications/), please see [the XML schema](/uwp/schemas/tiles/toastschema/schema-root).
18
+
If you would rather use raw XML instead of the Windows App SDK builder APIs, please see [the XML schema](/uwp/schemas/tiles/toastschema/schema-root).
19
19
20
20
[ToastContent](#toastcontent)
21
21
*[ToastVisual](#toastvisual)
@@ -474,4 +474,3 @@ New in Creators Update: A custom header that groups multiple notifications toget
474
474
## Related topics
475
475
476
476
*[Quickstart: Send a local toast and handle activation](/archive/blogs/tiles_and_toasts/quickstart-sending-a-local-toast-notification-and-handling-activations-from-it-windows-10)
477
-
*[Notifications library on GitHub](https://github.com/windows-toolkit/WindowsCommunityToolkit)
0 commit comments