3B Portals sends web push notifications through Firebase Cloud Messaging (FCM). Devices register from the portal, an admin triggers a send from a Flow or Apex, FCM delivers to the service worker, and the service worker displays the notification and reports back delivery and engagement.
Google_Service_Auth__mdt record named Push holds the Google service account credentials (project, client email, private key, endpoint, token URI, scopes). See Installation and setup.Google_FCM remote site must be active.window.globals.pushConfig by Portal.page.PortalServiceWorker Visualforce page must be enabled under Setup, Sites, (your site), Site Visualforce Pages. See below.The service worker that receives and displays push is served by the PortalServiceWorker Visualforce page (<site>/b3p__PortalServiceWorker) and registered at the site root. It used to be served from the Portal static resource path (/resource/b3p__Portal/service-worker.js). It is now the same worker that provides offline support and caching, so there is one worker per portal rather than two.
This means push has a new setup dependency. A Salesforce Site only serves Visualforce pages listed under Setup, Sites, (your site), Site Visualforce Pages, and Sites do not honour page access granted through a permission set. Add PortalServiceWorker next to Portal in that list on every Site that serves a portal. Install the 11.1 package, or deploy the updated Portal static resource together with the page when working from source. If you do not, worker registration fails silently and guest and community users stop receiving push, with no error shown. See Installation and setup section 6a.
Safari and other iOS browsers only show the portal notification prompt when running as an installed app. See App installation prompts.
PortalServiceWorker page at the site root) and gets an FCM token.b3p.Portal action savePushToken, passing the token, timezone, and browser.Web_Event__c of type Push Registration carrying the FCM token, timezone, and browser. There is no separate device object; each registration is a Web Event, and the send process reads the most recent tokens per contact.Users can also trigger registration from a page with the @setupPush action link. See Login and registration.
Tick Suppress_Push_Prompt__c on a Page__c to stop the "Would you like to receive timely notifications?" dialog appearing while that page is displayed, for pages that must stay obstruction free (or desktop only portals, where every page is ticked). Everything else about push is unchanged: an already registered device still receives notifications, but the @setupPush action link also respects prompt suppression. The flag is read at prompt time, so navigating onto a suppressed page during the short delay before the dialog also cancels it.
The entry point is the invocable Apex action "3B Send Push Notification" (PushService.send), category 3B Portals. An admin or staffing user typically calls it from a record triggered Flow.
Inputs per request:
contactIds (required): the target contacts.pushTitle: the notification title.pushBody (required): the body text.link (optional): a click through URL.What happens:
send enqueues a queueable batch that processes at most 25 requests per job and chains itself for the rest, staying under callout limits.Push_Message__c per sent message, linking the Contact and the registration, with status Sent (or the FCM error), the FCM message id, the body, the target URL, and the unique id.Because messages are data only, the service worker is responsible for actually displaying them.
The service worker (script shipped in the Portal static resource, served through the PortalServiceWorker page) initialises Firebase messaging:
@testPush action link sends a local test notification.message_id parameter appended.The client reports status back to Apex b3p.Portal action upadtePushStatus (spelled that way in the API), which upserts the Push_Message__c on its unique id:
message_id URL).So each Push_Message__c carries the lifecycle Sent, Received, Clicked, keyed on the unique id minted at send time. The app badge is cleared on load and when the app becomes visible.
Suppress_Push_Prompt__c ticked, or the user may not be logged in, may be on mobile without installing the PWA, may have previously soft declined, or the browser may not support notifications.PortalServiceWorker is enabled under Site Visualforce Pages, then check the Push service auth record, the Google_FCM remote site, and that the contact has a Push Registration Web Event with a current token.NotRegistered status indicates the token is no longer valid.