Connect to Azure Notification Hubs
The server SDK sendMobileNotifications function allows you to send notifications to subscribed user devices via the Azure Notifications Hub push engine. To connect FintechOS Platform with the Azure Notifications Hub, follow the steps below:
- Configure your notifications hub on the Microsoft Azure cloud computing service. For details, see the Azure Notification Hubs documentation.NOTE
You have to create one notification hub per mobile app, per environment. - In Vault, add secrets for the hub name and endpoint settings of each client application, based on the model below:
Key Path | Key Name |
---|---|
kv/<environment>/<application>/app-settings | azure-mobile-notifications-myApp1-hubname |
kv/<environment>/<application>/app-settings | azure-mobile-notifications-myApp1-endpoint |
kv/<environment>/<application>/app-settings | azure-mobile-notifications-myApp2-hubname |
kv/<environment>/<application>/app-settings | azure-mobile-notifications-myApp2-endpoint |
Key Name | Key Value |
---|---|
azure-mobile-notifications-myApp1-hubname | xxxhubname1 |
azure-mobile-notifications-myApp1-endpoint | Endpoint=sb://xxxnamespace1.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature1;SharedAccessKey=xxxxxxxxx1 |
azure-mobile-notifications-myApp2-hubname | xxxhubname2 |
azure-mobile-notifications-myApp2-endpoint | Endpoint=sb://xxxnamespace2.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature2;SharedAccessKey=xxxxxxxxx2 |
In the example above:
- We set up two client applications that will receive notifications: myApp1 and myApp2.
- The notifications are sent using the xxxhubname1 and xxxhubname2 Azure notifications hubs respectively.
- The endpoints for the two hubs are sb://xxxnamespace1.servicebus.windows.net/ and sb://xxxnamespace2.servicebus.windows.net/.
- The shared access key names are DefaultFullSharedAccessSignature1 and DefaultFullSharedAccessSignature2.
- The shared access keys are xxxxxxxxx1 and xxxxxxxxx2.
Push Notifications Log
Sent notifications are saved in the FTOS_DPA_MessageQueue table. The table contains an entry for each notification sent to each user. This message queue can be viewed at the http://localhost:57123/Main#/entity/FTOS_DPA_MessageQueue/list link:
Attribute | Description |
---|---|
ToAddress | Mobile app name. |
UserId | ID of the user that received the notification. |
Subject | Message queue subject set in the sendMobileNotifications function call that initiated the notification push. |
Body | Message received by the recipient. |
ChannelProvider | Provider with the same name as the Mobile App Name. |
CommunicationChannel | Hardcoded to AzureNotificationHub. |
ChannelProviderParams | Recipient filter used when sending the notification (example: "role: developer"). |
MessageStatus | Hardcoded to Sent. If notifications were not successfully received, check the logging in the Azure Portal. |