Marketing Cloud SDK / com.salesforce.marketingcloud.notifications / NotificationCustomizationOptions

NotificationCustomizationOptions

open class NotificationCustomizationOptions

The class holds any notification customization options allowed by the SDK. It is designed to make understanding and customizing notifications easier than in previous versions of the SDK. With this you can elect to take one of two possible options for customization:

Option one is a guided approach where in you can provide, at a minimum, the resource ID for the notification's small icon. Optionally, you could provide a NotificationManager.NotificationLaunchIntentProvider to customize the destination of a notification when clicked, and/or a NotificationManager.NotificationChannelIdProvider to specify on a per message basis which notification channel will be assigned to the notification.

Option two will require you to provide a NotificationManager.NotificationBuilder in which you will be responsible for the entire process of setting up the notification. These responsibilities include, but are not limited to:

The SDK will still display the notification with this option.

See Also
NotificationManager#getDefaultNotificationBuilder(Context, NotificationMessage, String, int)NotificationManager#createDefaultNotificationChannel(Context)

Functions

create

Creates a NotificationCustomizationOptions with only a NotificationManager.NotificationBuilder. This options leaves everything about setting up the notification up to you. See "Option two" in the class documentation for more details.

open static fun create(notificationBuilder: NotificationBuilder): NotificationCustomizationOptions

Creates a NotificationCustomizationOptions with only the notification's small icon resource id. This is the simplest approach to notifications in the SDK. Everything else will be handled by the SDK.

open static fun create(smallIconResId: Int): NotificationCustomizationOptions

Created a NotificationCustomizationOptions with the notification's small icon resource id and optional instances of NotificationManager.NotificationLaunchIntentProvider and NotificationManager.NotificationChannelIdProvider.

open static fun create(smallIconResId: Int, launchIntentProvider: NotificationLaunchIntentProvider?, channelIdProvider: NotificationChannelIdProvider?): NotificationCustomizationOptions

toString

open fun toString(): String