NotificationCustomizationOptions

Package 

com.salesforce.marketingcloud.pushfeature.notifications

Description 

This class manages notification customization settings for the SDK. It offers two approaches for customizing push notifications:

Option 1 - Guided Approach: Provide a small icon resource ID at minimum. Optionally add a NotificationLaunchIntentProvider for click handling or a NotificationChannelIdProvider for per-message channel assignment.

Option 2 - Full Control: Supply a NotificationBuilder to manage the complete notification setup, including:

  • Creating the NotificationCompat.Builder
  • Setting the notification channel
  • Routing intents through SDK analytics via NotificationManager.redirectIntentForAnalytics

The SDK handles notification display in both scenarios.

Class Declaration 

1class NotificationCustomizationOptions

Properties 

channelIdProvider 

1val channelIdProvider: NotificationManager.NotificationChannelIdProvider?

Provider for determining notification channel IDs on a per-message basis.

launchIntentProvider 

1val launchIntentProvider: NotificationManager.NotificationLaunchIntentProvider?

Provider for customizing the intent when a notification is clicked.

notificationBuilder 

1val notificationBuilder: NotificationManager.NotificationBuilder?

Custom builder for complete control over notification creation.

smallIconResId 

1val smallIconResId: Int

Resource ID for the notification’s small icon.

Nested Types 

Companion 

1object Companion

Companion object for the NotificationCustomizationOptions class.

See Also 

  • NotificationManager.Companion.getDefaultNotificationBuilder
  • NotificationManager.Companion.createDefaultNotificationChannel