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
Copy file name to clipboardExpand all lines: hub/apps/develop/notifications/push-notifications/push-quickstart.md
+6-9Lines changed: 6 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,10 +114,10 @@ using namespace winrt::Microsoft::Windows::PushNotifications;
114
114
115
115
If you get a "Can't find Microsoft.Windows.PushNotifications" error, that likely means the header files haven't been generated. Build the app without the namespaces first (keep the includes without an error), then try adding them in again.
116
116
117
-
### Step 2: Add your COM activator to your app's manifest
117
+
### Step 3: Add your COM activator to your app's manifest
118
118
119
119
> [!IMPORTANT]
120
-
> If your app is unpackaged (that is, it lacks package identity at runtime), then skip to **Step 3: Register for and respond to push notifications on app startup**.
120
+
> If your app is unpackaged (that is, it lacks package identity at runtime), then skip to **Step 4: Register for and respond to push notifications on app startup**.
121
121
122
122
If your app is packaged (including packaged with external location):
123
123
Open your **Package.appxmanifest**. Add the following inside the `<Application>` element. Replace the `Id`, `Executable`, and `DisplayName` values with those specific to your app.
@@ -152,9 +152,9 @@ Open your **Package.appxmanifest**. Add the following inside the `<Application>`
152
152
```
153
153
154
154
>[!NOTE]
155
-
> An example of the completed C++ classforthe sample can be found [after Step 4](#sample-code). Steps 3 and 4 provide step-by-step guidance to add each piece in the final sample.
155
+
> An example of the completed C++ classforthis example can be found [after Step 5](#example-code). Steps 4 and 5 provide step-by-step guidance to add each piece in the final example.
156
156
157
-
### Step 3: Register for and respond to push notifications on app startup
157
+
### Step 4: Register for and respond to push notifications on app startup
158
158
159
159
Update your app's `main()` method to add the following:
160
160
@@ -180,7 +180,7 @@ Next, add a check if the PushNotification APIs are supported with [PushNotificat
180
180
181
181
Now that there's confirmed push notification support, add in behavior based on [PushNotificationReceivedEventArgs](/windows/windows-app-sdk/api/winrt/microsoft.windows.pushnotifications.pushnotificationreceivedeventargs).
182
182
183
-
### Step 4: Request a WNS Channel URI and register it with the WNS server
183
+
### Step 5: Request a WNS Channel URI and register it with the WNS server
184
184
185
185
WNS Channel URIs are the HTTP endpoints for sending push notifications. Each client must request a Channel URI and register it with the WNS server to receive push notifications.
The **PushNotificationManager** will attempt to create a Channel URI, retrying automatically for no more than 15 minutes. Create an event handler to wait for the call to complete. Once the call is complete, if it was successful, register the URI with the WNS server.
202
202
203
-
> [!NOTE]
204
-
> To use LOG_HR_MSG included in the following code chunks, use Package Manager to import `Microsoft.Windows.ImplementationLibrary`, version 1.0.220914.1.
0 commit comments