Skip to content

Commit 0753483

Browse files
authored
Merge pull request #299198 from sethmanheim/nhfresh5-1
Freshness pass on top PV ANH articles
2 parents 84f71bd + e3b9782 commit 0753483

15 files changed

+670
-780
lines changed

articles/notification-hubs/android-sdk.md

Lines changed: 49 additions & 73 deletions
Large diffs are not rendered by default.

articles/notification-hubs/browser-push.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ manager: lizross
77
ms.service: azure-notification-hubs
88
ms.tgt_pltfrm: mobile-multiple
99
ms.topic: article
10-
ms.date: 03/19/2024
10+
ms.date: 05/01/2025
1111
ms.author: sethm
12-
ms.reviewer: heathertian
13-
ms.lastreviewed: 03/19/2024
12+
1413
---
1514

1615
# Web push notifications with Azure Notification Hubs
1716

18-
This article describes how to send browser push notifications to single users through Azure Notification Hubs.
17+
This article describes how to send browser push notifications to single users using Azure Notification Hubs.
1918

2019
At a high level, the process is:
2120

@@ -24,18 +23,18 @@ At a high level, the process is:
2423
- [Using the REST API](#set-credentials-using-rest-api)
2524
- [Using the Azure SDKs](#set-credentials-using-azure-sdks)
2625

27-
2. [Create registrations and installations](#create-registrations-and-installations).
26+
1. [Create registrations and installations](#create-registrations-and-installations).
2827

29-
3. [Send push notifications](#send-push-notifications):
28+
1. [Send push notifications](#send-push-notifications):
3029
- [Direct sends](#create-direct-sends)
3130
- [Batch (audience) sends](#create-audience-sends)
3231
- [Debug/test sends](#create-debugtest-sends)
3332

3433
## Overview
3534

36-
Web push (or browser push) is a type of notification that customers get on their desktop browsers, or in some cases mobile browsers, on a per-website basis.
35+
Web push (or *browser push*) is a type of notification that customers get on their desktop browsers, or in some cases mobile browsers, on a per-website basis.
3736

38-
Azure Notification Hubs now supports [*browser push*](https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications) for all major browsers, including Microsoft Edge, Google Chrome, and Mozilla Firefox. Apple Safari isn't included. For Apple Safari, you can use existing APNS support as described in [Configuring Safari Push Notifications](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/NotificationProgrammingGuideForWebsites/PushNotifications/PushNotifications.html#//apple_ref/doc/uid/TP40013225-CH3-SW1), with certificate-based authentication.
37+
Azure Notification Hubs now supports [browser push](https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications) for all major browsers, including Microsoft Edge, Google Chrome, and Mozilla Firefox. Apple Safari isn't included. For Apple Safari, you can use existing APNS support as described in [Configure Safari push notifications](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/NotificationProgrammingGuideForWebsites/PushNotifications/PushNotifications.html#//apple_ref/doc/uid/TP40013225-CH3-SW1), with certificate-based authentication.
3938

4039
Browser push is supported across platforms on devices with the following operating systems and browsers.
4140

@@ -64,7 +63,7 @@ Browser push support on mobile devices:
6463

6564
## Set credentials
6665

67-
To subscribe to browser push notifications on your web site, you can use VAPID keys. You can generate VAPID credentials by using services such as the [VAPID key generator](https://www.attheminute.com/vapid-key-generator/). The credentials should look similar to the following:
66+
To subscribe to browser push notifications on your web site, you can use *VAPID* keys. You can generate VAPID credentials by using services such as the [VAPID key generator](https://www.attheminute.com/vapid-key-generator/). The credentials should look similar to the following example:
6867

6968
```json
7069
{
@@ -89,13 +88,12 @@ To set browser push credentials in the Azure portal, follow these steps:
8988

9089
[![Screenshot showing the Browser (Web Push) blade in Notification Hubs.](media/browser-push/notification-hubs-browser-web-push.png)](media/browser-push/notification-hubs-browser-web-push.png#lightbox)
9190

92-
1. Enter your existing VAPID keys, or generate a new VAPID key pair using a service such as the [VAPID Key Generator](https://www.attheminute.com/vapid-key-generator/).
93-
91+
1. Enter your existing VAPID keys, or generate a new VAPID key pair using a service such as the [VAPID key generator](https://www.attheminute.com/vapid-key-generator/).
9492
1. Select **Save**.
9593

9694
### Set credentials using REST API
9795

98-
You can also set the browser credentials for browser push by using the REST API, such as using the [Create Or Update Hub REST API](/rest/api/notificationhubs/notification-hubs/create-or-update) method, the Azure Resource Manager API, or the V2 RP.
96+
You can also set the browser credentials for browser push by using the REST API, such as using the [Create or update Hub REST API](/rest/api/notificationhubs/notification-hubs/create-or-update) method, the Azure Resource Manager API, or the V2 RP.
9997

10098
Enter the credentials in this format, providing the subscription ID, resource group, namespace, and notification hub:
10199

@@ -105,7 +103,7 @@ https://management.azure.com/subscriptions/{subcription}/resourceGroups/{resourc
105103

106104
### Set credentials using Azure SDKs
107105

108-
You can set the credentials for Browser Push using the Azure SDKs. Here's an example using the .NET SDK:
106+
You can set the credentials for browser push using the Azure SDKs. Here's an example using the .NET SDK:
109107

110108
```csharp
111109
var browserCreds = new BrowserCredential
@@ -207,7 +205,7 @@ After you [set credentials for browser push](#set-credentials) and [create regis
207205

208206
### Create direct sends
209207

210-
For a direct send, you'll need the endpoint URI, p25DH key, and auth secret from a browser subscription. For more information about direct send notifications, see [Direct send](/rest/api/notificationhubs/direct-send).
208+
For a direct send, you need the endpoint URI, p25DH key, and auth secret from a browser subscription. For more information about direct send notifications, see [Direct send](/rest/api/notificationhubs/direct-send).
211209

212210
To create a direct send notification, follow these steps:
213211

@@ -265,11 +263,8 @@ After you [create registrations for the devices](#create-registrations-and-insta
265263
[![Screenshot showing the Test Send blade in a notification hub, for sending a test/debug notification.](media/browser-push/notification-hubs-test-send.png)](media/browser-push/notification-hubs-test-send.png#lightbox)
266264

267265
1. In the **Platform** field, select **Browser**.
268-
269266
1. Specify **Send to Tag Expression**.
270-
271267
1. Modify **Payload** to your desired message.
272-
273268
1. Select **Send**.
274269

275270
## Next steps

articles/notification-hubs/configure-notification-hub-portal-pns-settings.md

Lines changed: 33 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,21 @@ author: sethmanheim
66
manager: lizross
77
ms.service: azure-notification-hubs
88
ms.topic: quickstart
9-
ms.date: 06/30/2023
9+
ms.date: 05/01/2025
1010
ms.author: sethm
11-
ms.reviewer: thsomasu
12-
ms.lastreviewed: 02/14/2019
1311
ms.custom: mode-ui, devx-track-azurecli
1412
---
1513

1614
# Quickstart: Set up push notifications in a notification hub
1715

18-
Azure Notification Hubs provides a push engine that's easy to use and that scales out. Use Notification Hubs to send notifications to any platform (iOS, Android, Windows, Baidu) and from any back end (cloud or on-premises). For more information, see [What is Azure Notification Hubs?](notification-hubs-push-notification-overview.md).
16+
Azure Notification Hubs provides a push engine that's easy to use and that scales out. Use Notification Hubs to send notifications to any platform (iOS, Android, Windows) and from any back end (cloud or on-premises). For more information, see [What is Azure Notification Hubs?](notification-hubs-push-notification-overview.md).
1917

20-
In this quickstart, you'll use the platform notification system (PNS) settings in Notification Hubs to set up push notifications on multiple platforms. The quickstart shows you the steps to take in the Azure portal. [Google Firebase Cloud Messaging](?tabs=azure-cli#google-firebase-cloud-messaging-fcm) includes instructions for using the Azure CLI.
18+
In this quickstart, you use the platform notification system (PNS) settings in Notification Hubs to set up push notifications on multiple platforms. The quickstart shows you the steps to take when you use the Azure portal. [Google Firebase Cloud Messaging](?tabs=azure-cli#google-firebase-cloud-messaging-fcm) includes instructions for using the Azure CLI.
2119

2220
> [!NOTE]
2321
> For information about Firebase Cloud Messaging deprecation and migration steps, see [Google Firebase Cloud Messaging migration](notification-hubs-gcm-to-fcm.md).
2422
25-
If you haven't already created a notification hub, create one now. For more information, see [Create an Azure notification hub in the Azure portal](create-notification-hub-portal.md) or [Create an Azure notification hub using the Azure CLI](create-notification-hub-azure-cli.md).
23+
If you didn't already create a notification hub, create one now. For more information, see [Create an Azure notification hub in the Azure portal](create-notification-hub-portal.md) or [Create an Azure notification hub using the Azure CLI](create-notification-hub-azure-cli.md).
2624

2725
## Apple Push Notification Service
2826

@@ -32,35 +30,31 @@ To set up Apple Push Notification Service (APNS):
3230

3331
1. For **Authentication Mode**, select either **Certificate** or **Token**.
3432

35-
a. If you select **Certificate**:
36-
* Select the file icon, and then select the *.p12* file you want to upload.
37-
* Enter a password.
38-
* Select **Sandbox** mode. Or, to send push notifications to users who purchased your app from the store, select **Production** mode.
39-
40-
![Screenshot of an APNS certificate configuration in the Azure portal.](media/configure-notification-hub-portal-pns-settings/notification-hubs-apple-config-cert.png)
41-
42-
43-
44-
b. If you select **Token**:
45-
46-
* Enter the values for **Key ID**, **Bundle ID**, **Team ID**, and **Token**.
47-
* Select **Sandbox** mode. Or, to send push notifications to users who purchased your app from the store, select **Production** mode.
48-
49-
![Screenshot of an APNS token configuration in the Azure portal.](media/configure-notification-hub-portal-pns-settings/notification-hubs-apple-config-token.png)
50-
51-
52-
33+
1. If you select **Certificate**:
34+
35+
* Select the file icon, and then select the *.p12* file you want to upload.
36+
* Enter a password.
37+
* Select **Sandbox** mode. Or, to send push notifications to users who purchased your app from the store, select **Production** mode.
38+
39+
![Screenshot of an APNS certificate configuration in the Azure portal.](media/configure-notification-hub-portal-pns-settings/notification-hubs-apple-config-cert.png)
40+
41+
1. If you select **Token**:
42+
43+
* Enter the values for **Key ID**, **Bundle ID**, **Team ID**, and **Token**.
44+
* Select **Sandbox** mode. Or, to send push notifications to users who purchased your app from the store, select **Production** mode.
45+
46+
![Screenshot of an APNS token configuration in the Azure portal.](media/configure-notification-hub-portal-pns-settings/notification-hubs-apple-config-token.png)
47+
5348
For more information, see [Send push notifications to iOS apps using Azure Notification Hubs](ios-sdk-get-started.md).
5449

5550
## Google Firebase Cloud Messaging V1 (FCMv1)
5651

5752
To set up push notifications for Google FCMv1:
5853

5954
1. In the Azure portal, on the **Notification Hub** page, select **Google (FCMv1)** from the left menu.
60-
2. Update the **Private Key**, **Project ID**, and **Client Email** values from the service account JSON file obtained from the Firebase Console.
55+
1. Update the **Private Key**, **Project ID**, and **Client Email** values from the service account JSON file obtained from the Firebase Console.
6156
1. Select **Save**.
6257

63-
6458
![Screenshot that shows how to configure Notification Hubs for Google FCMv1.](media/configure-notification-hub-portal-pns-settings/fcm-v1-key.png)
6559

6660
When you complete these steps, an alert indicates that the notification hub has been successfully updated. The **Save** button is disabled.
@@ -70,37 +64,35 @@ When you complete these steps, an alert indicates that the notification hub has
7064
> [!NOTE]
7165
> Firebase Cloud Messaging (FCM) has been deprecated and is no longer supported.
7266
73-
# [Portal](#tab/azure-portal)
67+
### [Portal](#tab/azure-portal)
7468

7569
To set up push notifications for Google FCM:
7670

7771
1. In the Azure portal, on the **Notification Hub** page, select **Google (GCM/FCM)** from the left menu.
78-
2. Paste the **API Key** for the Google FCM project that you saved earlier.
72+
1. Paste the **API Key** for the Google FCM project that you saved earlier.
7973
1. Select **Save**.
8074

8175
![Screenshot that shows how to configure Notification Hubs for Google FCM.](media/configure-notification-hub-portal-pns-settings/fcm-server-key.png)
82-
83-
84-
76+
8577
When you complete these steps, an alert indicates that the notification hub has been successfully updated. The **Save** button is disabled.
8678

87-
# [Azure CLI](#tab/azure-cli)
79+
### [Azure CLI](#tab/azure-cli)
8880

89-
You will need the **API Key** for your Google Firebase Cloud Messaging (FCM) project.
81+
You need the **API Key** for your Google Firebase Cloud Messaging (FCM) project.
9082

9183
[!INCLUDE [azure-cli-prepare-your-environment.md](~/reusable-content/azure-cli/azure-cli-prepare-your-environment-h3.md)]
9284

93-
- This article requires version 2.0.67 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
85+
* This article requires version 2.0.67 or later of the Azure CLI. If you use Azure Cloud Shell, the latest version is already installed.
9486

95-
### Set up push notifications for Google FCM
87+
## Set up push notifications for Google FCM
9688

9789
1. Use the [az notification-hub credential gcm update](/cli/azure/notification-hub/credential/gcm#az-notification-hub-credential-gcm-update) command to add your Google API key to your notification hub.
9890

9991
```azurecli
10092
az notification-hub credential gcm update --resource-group spnhubrg --namespace-name spnhubns --notification-hub-name spfcmtutorial1nhub --google-api-key myKey
10193
```
10294

103-
2. The Android App needs a connection string to connect with the notification hub. Use the [az notification-hub authorization-rule list](/cli/azure/notification-hub/authorization-rule#az-notification-hub-authorization-rule-list) command to list the available access policies. Use the [az notification-hub authorization-rule list-keys](/cli/azure/notification-hub/authorization-rule#az-notification-hub-authorization-rule-list-keys) command to get the access policy connection strings. Specify the **primaryConnectionString** or **secondaryConnectionString** in the `--query` parameter to get the primary connection string directly.
95+
1. The Android App needs a connection string to connect with the notification hub. Use the [az notification-hub authorization-rule list](/cli/azure/notification-hub/authorization-rule#az-notification-hub-authorization-rule-list) command to list the available access policies. Use the [az notification-hub authorization-rule list-keys](/cli/azure/notification-hub/authorization-rule#az-notification-hub-authorization-rule-list-keys) command to get the access policy connection strings. Specify the **primaryConnectionString** or **secondaryConnectionString** in the `--query` parameter to get the primary connection string directly.
10496

10597
```azurecli
10698
#list access policies for a notification hub
@@ -113,7 +105,7 @@ You will need the **API Key** for your Google Firebase Cloud Messaging (FCM) pro
113105
az notification-hub authorization-rule list-keys --resource-group spnhubrg --namespace-name spnhubns --notification-hub-name spfcmtutorial1nhub --name myAccessPolicyName --query primaryConnectionString
114106
```
115107

116-
3. Use the [az notification-hub test-send](/cli/azure/notification-hub#az-notification-hub-test-send) command to test sending messages to the Android App.
108+
1. Use the [az notification-hub test-send](/cli/azure/notification-hub#az-notification-hub-test-send) command to test sending messages to the Android App.
117109

118110
```azurecli
119111
#test with message body
@@ -123,7 +115,7 @@ You will need the **API Key** for your Google Firebase Cloud Messaging (FCM) pro
123115
az notification-hub test-send --resource-group spnhubrg --namespace-name spnhubns --notification-hub-name spfcmtutorial1nhub --notification-format gcm --payload "{\"data\":{\"message\":\"my JSON string\"}}"
124116
```
125117

126-
Get Azure CLI references for other platforms with the [az notification-hub credential](/cli/azure/notification-hub/credential) command.
118+
You can get Azure CLI references for other platforms with the [az notification-hub credential](/cli/azure/notification-hub/credential) command.
127119

128120
For more information about sending notifications to an Android application, see [Send push notifications to Android devices using Firebase](notification-hubs-android-push-notification-google-fcm-get-started.md).
129121

@@ -134,29 +126,14 @@ For more information about sending notifications to an Android application, see
134126
To set up Windows Push Notification Service (WNS):
135127

136128
1. In the Azure portal, on the **Notification Hub** page, select **Windows (WNS)** from the left menu.
137-
2. Enter values for **Package SID** and **Security Key**.
129+
1. Enter values for **Package SID** and **Security Key**.
138130
1. Select **Save**.
139131

140132
![Screenshot that shows the Package SID and Security Key boxes.](media/configure-notification-hub-portal-pns-settings/notification-hub-configure-wns.png)
141-
142-
143-
144-
For information, see [Send notifications to UWP apps by using Azure Notification Hubs](notification-hubs-windows-store-dotnet-get-started-wns-push-notification.md).
145-
146-
## Baidu (Android China)
147133

148-
To set up push notifications for Baidu:
149-
150-
1. In the Azure portal, on the **Notification Hub** page, select **Baidu (Android China)** from the left menu.
151-
2. Enter the **API Key** that you obtained from the Baidu console in the Baidu cloud push project.
152-
3. Enter the **Secret Key** that you obtained from the Baidu console in the Baidu cloud push project.
153-
1. Select **Save**.
134+
For information, see [Send notifications to UWP apps by using Azure Notification Hubs](notification-hubs-windows-store-dotnet-get-started-wns-push-notification.md).
154135

155-
![Screenshot of Notification Hubs that shows the Baidu (Android China) configuration for push notifications.](media/configure-notification-hub-portal-pns-settings/azure-notification-services-baidu.png)
156-
157-
158-
159-
When you complete these steps, an alert indicates that the notification hub has been successfully updated. The **Save** button is disabled.
136+
When you complete these steps, an alert indicates that the notification hub was successfully updated. The **Save** button is disabled.
160137

161138
For more information, see [Get started with Notification Hubs by using Baidu](notification-hubs-baidu-china-android-notifications-get-started.md).
162139

@@ -170,4 +147,3 @@ To learn more about how to push notifications to various platforms, see these tu
170147
* [Send notifications to Android devices by using Notification Hubs and Google FCM](notification-hubs-android-push-notification-google-fcm-get-started.md)
171148
* [Send notifications to a UWP app running on a Windows device](notification-hubs-windows-store-dotnet-get-started-wns-push-notification.md)
172149
* [Send notifications by using Notification Hubs and Baidu cloud push](notification-hubs-baidu-china-android-notifications-get-started.md)
173-

articles/notification-hubs/create-notification-hub-portal.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Create an Azure notification hub using the Azure portal | Microsoft Docs
3-
description: In this tutorial, you learn how to create an Azure notification hub by using the Azure portal.
2+
title: Create an Azure notification hub using the Azure portal
3+
description: Learn how to create an Azure notification hub using the Azure portal.
44
services: notification-hubs
55
author: sethmanheim
66
ms.author: sethm
77
manager: lizross
88
ms.reviewer: rebpen
9-
ms.date: 02/21/2024
9+
ms.date: 05/01/2025
1010
ms.topic: quickstart
1111
ms.service: azure-notification-hubs
1212
ms.custom: mode-ui

0 commit comments

Comments
 (0)