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 send_notification() 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 push_notification_service reference used below is already defined in the component instance page.

    
copy
#Send push notifications using userID's user_list = [1234556789098, 6756467677890] logging.info(push_notification_service.web().send_notification("Hi there! The task you scheduled has been completed.", user_list))

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 send_notification() along with the message string in the same way.

    
copy
#Send push notifications using user email addresses's user_list = ["amelia.burrows@gmail.com", "emma.hillary@gmail.com"] logging.info(push_notification_service.web().send_notification("Hi there! The task you scheduled has been completed.", user_list))

Last Updated 2023-12-18 16:20:08 +0530 +0530

ON THIS PAGE