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: articles/notification-hubs/configure-notification-hub-portal-pns-settings.md
+67-18Lines changed: 67 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Azure Notification Hubs provides a push engine that's easy to use and that scale
21
21
22
22
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.
23
23
24
-
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).
24
+
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).
25
25
26
26
## Apple Push Notification Service
27
27
@@ -49,18 +49,67 @@ For more information, see [Push notifications to iOS by using Azure Notification
49
49
50
50
## Google Firebase Cloud Messaging
51
51
52
+
# [Portal](#tab/azure-portal)
53
+
52
54
To set up push notifications for Google Firebase Cloud Messaging (FCM):
53
55
54
-
1. In the Azure portal, on the **Notification Hub** page, select **Google (GCM/FCM)** from the left menu.
55
-
2. Paste the **API Key** for the FCM project that you saved earlier.
56
-
3. Select **Save**.
56
+
1. In the Azure portal, on the **Notification Hub** page, select **Google (GCM/FCM)** from the left menu.
57
+
2. Paste the **API Key** for the FCM project that you saved earlier.
58
+
3. Select **Save**.
57
59
58
60

59
61
60
-
When you complete these steps, an alert indicates that the notification hub has been successfully updated. The **Save** button is disabled.
62
+
When you complete these steps, an alert indicates that the notification hub has been successfully updated. The **Save** button is disabled.
61
63
62
64
For more information, see [Push notifications to Android devices by using Notification Hubs and Google FCM](notification-hubs-android-push-notification-google-fcm-get-started.md).
63
65
66
+
# [Azure CLI](#tab/azure-cli)
67
+
68
+
### Prerequisites
69
+
70
+
Before you begin, you must have the following:
71
+
72
+
* The [Azure CLI](/cli/azure/install-azure-cli) version 2.0.67 or later.
73
+
74
+
* The Azure CLI [extension for Notification Hubs](/cli/azure/ext/notification-hub/notification-hub).
75
+
* The **API Key** for a Google Firebase Cloud Messaging (FCM) project.
76
+
77
+
### Set up push notifications for Google Firebase Cloud Messaging (FCM)
78
+
79
+
1. Use the [az notification-hub credential gcm update](/cli/azure/ext/notification-hub/notification-hub/credential/gcm#ext-notification-hub-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/ext/notification-hub/notification-hub/authorization-rule#ext-notification-hub-az-notification-hub-authorization-rule-list) command to list the available access policies. Run the [az notification-hub authorization-rule list-keys](/cli/azure/ext/notification-hub/notification-hub/authorization-rule#ext-notification-hub-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.
86
+
87
+
```azurecli
88
+
#list access policies for a notification hub
89
+
az notification-hub authorization-rule list --resource-group spnhubrg --namespace-name spnhubns --notification-hub-name spfcmtutorial1nhub --output table
90
+
91
+
#list keys and connection strings for a notification hub access policy
3. Use the [az notification-hub test-send](/cli/azure/ext/notification-hub/notification-hub#ext-notification-hub-az-notification-hub-test-send) command to test sending messages to the Android App.
> Get Azure CLI references for other platforms with the [az notification-hub credential](/cli/azure/ext/notification-hub/notification-hub/credential) command.
110
+
111
+
---
112
+
64
113
## Windows Push Notification Service
65
114
66
115
To set up Windows Push Notification Service (WNS):
@@ -75,7 +124,7 @@ For information, see [Send notifications to UWP apps by using Azure Notification
75
124
76
125
## Microsoft Push Notification Service for Windows Phone
77
126
78
-
To set up Microsoft Push Notification Service (MPNS) for Windows Phone:
127
+
To set up Microsoft Push Notification Service (MPNS) for Windows Phone:
79
128
80
129
1. In the Azure portal, on the **Notification Hub** page, select **Windows Phone (MPNS)** from the left menu.
81
130
1. Enable either unauthenticated or authenticated push notifications:
@@ -92,30 +141,30 @@ To set up Microsoft Push Notification Service (MPNS) for Windows Phone:
92
141
* On the **Windows Phone (MPNS)** page, select **Save**.
93
142
94
143
For more information, see [Push notifications to Windows Phone apps by using Notification Hubs](notification-hubs-windows-mobile-push-notifications-mpns.md).
95
-
96
144
97
145
## Baidu (Android China)
98
146
99
147
To set up push notifications for Baidu:
100
148
101
-
1. In the Azure portal, on the **Notification Hub** page, select **Baidu (Android China)** from the left menu.
102
-
2. Enter the **Api Key** that you obtained from the Baidu console in the Baidu cloud push project.
103
-
3. Enter the **Secret Key** that you obtained from the Baidu console in the Baidu cloud push project.
104
-
4. Select **Save**.
149
+
1. In the Azure portal, on the **Notification Hub** page, select **Baidu (Android China)** from the left menu.
150
+
2. Enter the **Api Key** that you obtained from the Baidu console in the Baidu cloud push project.
151
+
3. Enter the **Secret Key** that you obtained from the Baidu console in the Baidu cloud push project.
152
+
4. Select **Save**.
105
153
106
154

107
155
108
-
When you complete these steps, an alert indicates that the notification hub has been successfully updated. The **Save** button is disabled.
156
+
When you complete these steps, an alert indicates that the notification hub has been successfully updated. The **Save** button is disabled.
109
157
110
158
For more information, see [Get started with Notification Hubs by using Baidu](notification-hubs-baidu-china-android-notifications-get-started.md).
111
159
112
160
## Next steps
113
-
In this quickstart, you learned how to configure platform notification system settings for a notification hub in the Azure portal.
161
+
162
+
In this quickstart, you learned how to configure platform notification system settings for a notification hub in the Azure portal.
114
163
115
164
To learn more about how to push notifications to various platforms, see these tutorials:
116
165
117
-
-[Push notifications to iOS devices by using Notification Hubs and APNS](notification-hubs-ios-apple-push-notification-apns-get-started.md)
118
-
-[Push notifications to Android devices by using Notification Hubs and Google FCM](notification-hubs-android-push-notification-google-fcm-get-started.md)
119
-
-[Push notifications to a UWP app running on a Windows device](notification-hubs-windows-store-dotnet-get-started-wns-push-notification.md)
120
-
-[Push notifications to a Windows Phone 8 app by using MPNS](notification-hubs-windows-mobile-push-notifications-mpns.md)
121
-
-[Push notifications by using Notification Hubs and Baidu cloud push](notification-hubs-baidu-china-android-notifications-get-started.md)
166
+
-[Push notifications to iOS devices by using Notification Hubs and APNS](notification-hubs-ios-apple-push-notification-apns-get-started.md)
167
+
-[Push notifications to Android devices by using Notification Hubs and Google FCM](notification-hubs-android-push-notification-google-fcm-get-started.md)
168
+
-[Push notifications to a UWP app running on a Windows device](notification-hubs-windows-store-dotnet-get-started-wns-push-notification.md)
169
+
-[Push notifications to a Windows Phone 8 app by using MPNS](notification-hubs-windows-mobile-push-notifications-mpns.md)
170
+
-[Push notifications by using Notification Hubs and Baidu cloud push](notification-hubs-baidu-china-android-notifications-get-started.md)
0 commit comments