ftos.messaging.sendMobileNotifications
IMPORTANT!
Starting with v24.3.0, this is renamed from sendMobileNotifications to ftos.messaging.sendMobileNotifications.
Starting with v24.3.0, this is renamed from sendMobileNotifications to ftos.messaging.sendMobileNotifications.
Sends a notification to subscribed user devices using the Azure Notifications Hub push engine.
IMPORTANT!
This function requires a valid connection to a preconfigured Azure Notifications Hub. For details, see the Platform documentation and the Azure Notifications Hub documentation.
This function requires a valid connection to a preconfigured Azure Notifications Hub. For details, see the Platform documentation and the Azure Notifications Hub documentation.
This is suitable for business logic modules of business service components.
Syntax
function ftos.messaging.sendMobileNotifications(appName: string, {message: string, mqsubject: string, roles: string[], users: string[]}): void
| Parameter | Description |
|---|---|
appName
|
Name of the mobile application. Determines which notification hub will handle the notifications. |
message
|
Contents of the text notification delivered to users. |
mqsubject
|
Contents saved in the Subject column of the FTOS_DPA_MessageQueue log. Does not affect the notification received by recipients. |
roles
|
Array of strings containing the user roles of the recipients. If the parameters match both the user name and user role for the same recipient, only one notification will be sent. |
users
|
Array of strings containing the user account names of the recipients. If the parameters match both the user name and user role for the same recipient, only one notification will be sent. |
Examples
In this example:
- We send a test notification for the MyFirstApp mobile application.
- The notification message is Test notification message from FintechOS.
- The sent notifications will be recorded in the message queue log with the following subject: Testing notifications subject.
- The notification recipients are the Guest and host users, who have Registered users roles.
ftos.messaging.sendMobileNotifications('MyFirstApp',{message:'Test notification message from FintechOS', mqsubject:'Testing notifications subject',roles:['Registered Users'], users:['Guest','host']});