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
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.
37
36
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.
39
38
40
39
Browser push is supported across platforms on devices with the following operating systems and browsers.
41
40
@@ -64,7 +63,7 @@ Browser push support on mobile devices:
64
63
65
64
## Set credentials
66
65
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:
68
67
69
68
```json
70
69
{
@@ -89,13 +88,12 @@ To set browser push credentials in the Azure portal, follow these steps:
89
88
90
89
[](media/browser-push/notification-hubs-browser-web-push.png#lightbox)
91
90
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/).
94
92
1. Select **Save**.
95
93
96
94
### Set credentials using REST API
97
95
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.
99
97
100
98
Enter the credentials in this format, providing the subscription ID, resource group, namespace, and notification hub:
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:
109
107
110
108
```csharp
111
109
varbrowserCreds=newBrowserCredential
@@ -207,7 +205,7 @@ After you [set credentials for browser push](#set-credentials) and [create regis
207
205
208
206
### Create direct sends
209
207
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).
211
209
212
210
To create a direct send notification, follow these steps:
213
211
@@ -265,11 +263,8 @@ After you [create registrations for the devices](#create-registrations-and-insta
Copy file name to clipboardExpand all lines: articles/notification-hubs/configure-notification-hub-portal-pns-settings.md
+33-57Lines changed: 33 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,23 +6,21 @@ author: sethmanheim
6
6
manager: lizross
7
7
ms.service: azure-notification-hubs
8
8
ms.topic: quickstart
9
-
ms.date: 06/30/2023
9
+
ms.date: 05/01/2025
10
10
ms.author: sethm
11
-
ms.reviewer: thsomasu
12
-
ms.lastreviewed: 02/14/2019
13
11
ms.custom: mode-ui, devx-track-azurecli
14
12
---
15
13
16
14
# Quickstart: Set up push notifications in a notification hub
17
15
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).
19
17
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.
21
19
22
20
> [!NOTE]
23
21
> For information about Firebase Cloud Messaging deprecation and migration steps, see [Google Firebase Cloud Messaging migration](notification-hubs-gcm-to-fcm.md).
24
22
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).
26
24
27
25
## Apple Push Notification Service
28
26
@@ -32,35 +30,31 @@ To set up Apple Push Notification Service (APNS):
32
30
33
31
1. For **Authentication Mode**, select either **Certificate** or **Token**.
34
32
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
-

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
-

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
+

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
+

47
+
53
48
For more information, see [Send push notifications to iOS apps using Azure Notification Hubs](ios-sdk-get-started.md).
54
49
55
50
## Google Firebase Cloud Messaging V1 (FCMv1)
56
51
57
52
To set up push notifications for Google FCMv1:
58
53
59
54
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.
61
56
1. Select **Save**.
62
57
63
-
64
58

65
59
66
60
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
70
64
> [!NOTE]
71
65
> Firebase Cloud Messaging (FCM) has been deprecated and is no longer supported.
72
66
73
-
# [Portal](#tab/azure-portal)
67
+
###[Portal](#tab/azure-portal)
74
68
75
69
To set up push notifications for Google FCM:
76
70
77
71
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.
79
73
1. Select **Save**.
80
74
81
75

82
-
83
-
84
-
76
+
85
77
When you complete these steps, an alert indicates that the notification hub has been successfully updated. The **Save** button is disabled.
86
78
87
-
# [Azure CLI](#tab/azure-cli)
79
+
###[Azure CLI](#tab/azure-cli)
88
80
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.
- 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.
94
86
95
-
###Set up push notifications for Google FCM
87
+
## Set up push notifications for Google FCM
96
88
97
89
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.
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.
104
96
105
97
```azurecli
106
98
#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
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.
117
109
118
110
```azurecli
119
111
#test with message body
@@ -123,7 +115,7 @@ You will need the **API Key** for your Google Firebase Cloud Messaging (FCM) pro
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.
127
119
128
120
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).
129
121
@@ -134,29 +126,14 @@ For more information about sending notifications to an Android application, see
134
126
To set up Windows Push Notification Service (WNS):
135
127
136
128
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**.
138
130
1. Select **Save**.
139
131
140
132

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)
147
133
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).
154
135
155
-

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.
160
137
161
138
For more information, see [Get started with Notification Hubs by using Baidu](notification-hubs-baidu-china-android-notifications-get-started.md).
162
139
@@ -170,4 +147,3 @@ To learn more about how to push notifications to various platforms, see these tu
170
147
*[Send notifications to Android devices by using Notification Hubs and Google FCM](notification-hubs-android-push-notification-google-fcm-get-started.md)
171
148
*[Send notifications to a UWP app running on a Windows device](notification-hubs-windows-store-dotnet-get-started-wns-push-notification.md)
172
149
*[Send notifications by using Notification Hubs and Baidu cloud push](notification-hubs-baidu-china-android-notifications-get-started.md)
0 commit comments