Send Push Notifications

Catalyst enables you to send push notifications to 50 users in a single function call. You can add the user IDs of all users to be notified in an array as shown below. You must then pass the array to the sendNotification() method, along with the message string to include in the notification. This string can be plain text, HTML, or a JSON object to be parsed.

The pushNotification instance used here is the component instance.

    
copy
var userList = []; //Include the user IDs of all users userList.push(1234556789098); userList.push(6756467677890); userList.push(3557866876887); catalystApp.pushNotification().web().sendNotification("Hi there! The task you scheduled has been completed.", userList); //Pass the array with the message string

You can also send the notifications to users by including their email addresses instead of their User IDs. You must add the email addresses in an array, and pass it to sendNotification() along with the message string in the same way.

    
copy
var userList = []; //Include the email addresses of the users userList.push("emma@zylker.com"); userList.push("p.boyle@zylker.com"); userList.push("noel@zylker.com"); catalystApp.pushNotification().web().sendNotification("Hi there! The task you scheduled has been completed.", userList); //Pass the array with the message string

Last Updated 2023-09-03 01:06:41 +0530 +0530

ON THIS PAGE