Quickstart: Set up push notifications in a notification hub
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?.
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 includes instructions for using the Azure CLI.
Note
For information about Firebase Cloud Messaging deprecation and migration steps, see Google Firebase Cloud Messaging migration.
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 or Create an Azure notification hub using the Azure CLI.
Apple Push Notification Service
To set up Apple Push Notification Service (APNS):
In the Azure portal, on the Notification Hub page, select Apple (APNS) from the left menu.
For Authentication Mode, select either Certificate or Token.
a. If you select Certificate:
Select the file icon, and then select the .p12 file you want to upload.
Enter a password.
Select Sandbox mode. Or, to send push notifications to users who purchased your app from the store, select Production mode.
b. If you select Token:
Enter the values for Key ID, Bundle ID, Team ID, and Token.
Select Sandbox mode. Or, to send push notifications to users who purchased your app from the store, select Production mode.
For more information, see Send push notifications to iOS apps using Azure Notification Hubs.
Google Firebase Cloud Messaging V1 (FCMv1)
To set up push notifications for Google FCMv1:
- In the Azure portal, on the Notification Hub page, select Google (FCMv1) from the left menu.
- Update the Private Key, Project ID, and Client Email values from the service account JSON file obtained from the Firebase Console.
- Select Save.
When you complete these steps, an alert indicates that the notification hub has been successfully updated. The Save button is disabled.
Google Firebase Cloud Messaging (FCM)
Note
Firebase Cloud Messaging (FCM) has been deprecated and is no longer supported.
To set up push notifications for Google FCM:
In the Azure portal, on the Notification Hub page, select Google (GCM/FCM) from the left menu.
Paste the API Key for the Google FCM project that you saved earlier.
Select Save.
When you complete these steps, an alert indicates that the notification hub has been successfully updated. The Save button is disabled.
Windows Push Notification Service
To set up Windows Push Notification Service (WNS):
In the Azure portal, on the Notification Hub page, select Windows (WNS) from the left menu.
Enter values for Package SID and Security Key.
Select Save.
For information, see Send notifications to UWP apps by using Azure Notification Hubs.
Baidu (Android China)
To set up push notifications for Baidu:
In the Azure portal, on the Notification Hub page, select Baidu (Android China) from the left menu.
Enter the API Key that you obtained from the Baidu console in the Baidu cloud push project.
Enter the Secret Key that you obtained from the Baidu console in the Baidu cloud push project.
Select Save.
When you complete these steps, an alert indicates that the notification hub has been successfully updated. The Save button is disabled.
For more information, see Get started with Notification Hubs by using Baidu.
Next steps
In this quickstart, you learned how to configure platform notification system settings for a notification hub in the Azure portal.
To learn more about how to push notifications to various platforms, see these tutorials: