Push Notifications

Revision as of 03:14, 25 November 2024 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

3B Portals & Mobile apps allows push notifications based on salesforce flows / apex triggers to be sent to mobile app subscribers. Setup

Setup

From version 2.0+, admins will need to go to Setup -> Custom Metadata -> Google Service Auths and create a new record. The record must be named "Push", leave all fields with the default configuration.

Sending Push Notifications

To send a push notification, the portal user must be signed in and must have granted "Push Notification Access" - a pop up will appear prompting them to grant access. Note that on mobile devices, the portal page must be added to the home screen for Push Notifications to work. Simply utilize the "3B Send Push Notification" flow invocable action, pass a list of contact ids that will receive the message and that's it.

Alternatively, you can use APEX to send push notifications (asynchronously) like so:

PushService.Requests req = new PushService.Requests();
req.contactIds = new List<Id>{'003WS000007J2TXYA0'};
req.pushTitle = 'Hello Title';
req.pushBody = 'Body of message';

PushService.send(new List<PushService.Requests>{req});

Troubleshooting

Web Event records are created against the contact record once they grant access to receive push notifications.