Push Notifications

Catalyst Push notifications enables you to send remote notifications to the users of your application, even when the app is not actively running on the user device. You can send push notifications to a specific list of target users. You can include alerts, updates, or promotional content for the user to engage with your application.

Before you send push notifications, you must enable it for your web app when the user allows it. You can do this by implementing this code snippet in your web client. You can also access this code from the Push Notifications section in your Catalyst remote console. You must ensure that you include the web initialization script.

Note: Catalyst Push Notifications is currently not available to Catalyst users accessing from the EU, AU, IN, or CA data centers.

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 notifyUser() 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.

Ensure the following packages are imported:

    
copy
import com.zc.component.notifications.ZCWebNotification;
    
copy
Long[] userList = new Long[5]; //Include the user IDs of all users userList[0] = 1234556789098L; userList[1] = 8704590865890L; userList[2] = 1452788189992L; userList[3] = 5344535567809L; userList[4] = 6568785589800L; ZCWebNotification.getInstance().notifyUser("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 a String array, and pass it to notifyUser() along with the message string in a similar way.

Ensure the following packages are imported:

    
copy
import com.zc.component.notifications.ZCWebNotification;
    
copy
String[] userEmailList = new String[3]; //Include the email addresses of the users userEmailList[0] = "emma@zylker.com"; userEmailList[1] = "p.boyle@zylker.com"; userEmailList[2] = "noel@zylker.com"; ZCWebNotification.getInstance().notifyUser("Hi there! The task you scheduled has been completed.", userEmailList); //Pass the array with the message string

Last Updated 2024-01-04 12:37:42 +0530 +0530