In exploring sending notifications to a user in Salesforce, I was confused by the purpose of the Custom Notification Type. To send a custom notification via a Flow, Apex code, or the API, you must first create a Custom Notification Type, but the Notification Title, Notification Body, Recipients IDs, and Target ID/Target Page Reference must still be specified when sending the notification. So what’s the point of the notification type?
The Custom Notification Type defines a Notification Name, an API Name, and Supported Channels. The Supported Channels determine where the notifications will show; options are Desktop, Mobile, and, if Mobile is checked, iOS and Android.
After some experimentation, this appears to be how those delivery channels operate:
- If Desktop is checked, then the notification will show with “bell notifications” on the desktop website.
- If Mobile is checked, nothing happens. You have to also select iOS and/or Android.
- If iOS and Android are checked, then the notification will display for the native app. Mobile browsers are not supported with the exception of iPad Safari in landscape.
Crucially, the Custom Notification Types appear in the mobile apps’ Push Notification Settings. Users can enable/disable push notifications by notification type. This appears to be the key reason for Custom Notification Types to exist: to allow users to customize their push notification experience on mobile devices.