RichButtonTemplate

Overview 

A data class representing a template for displaying rich buttons in push notifications. Part of the Salesforce Marketing Cloud Unified SDK Push Models Module (v1.0.2).

Package: com.salesforce.marketingcloud.pushmodels.rich.buttons

Inheritance: Implements Template

Class Declaration 

1data class RichButtonTemplate(
2    val items: List<RichButtonTemplate.RichButton>,
3    val style: Style? = null
4) : Template

Description 

A carousel template is used to display a list of items in a carousel.

Constructor 

Primary Constructor 

1constructor(
2    items: List<RichButtonTemplate.RichButton>,
3    style: Style? = null
4)

Parameters:

  • items: List of RichButton objects to display
  • style: Optional styling configuration for the template

Properties 

PropertyTypeDescription
identifierString?Override from Template, defaults to null
itemsList<RichButtonTemplate.RichButton>The list of rich buttons to display
styleStyle?Optional styling configuration
typeTemplate.TypeOverride from Template indicating template type

Nested Types 

RichButton 

1data class RichButton(
2    val identifier: String,
3    val title: Text? = null,
4    val icon: String? = null,
5    val style: Style? = null,
6    val actions: List<Action>? = listOf(Action.OpenApp)
7) : Parcelable, PushView

Properties:

  • identifier: Unique identifier for the button
  • title: Optional text content for the button
  • icon: Optional icon resource string
  • style: Optional button-specific styling
  • actions: List of actions to perform; defaults to opening the app

Companion 

1object Companion

A companion object for the RichButtonTemplate class.

Methods 

toString 

1open override fun toString(): String

Returns a string representation of the RichButtonTemplate object.

Related Types 

  • Template - Parent interface
  • Style - Styling configuration class
  • Action - Action type for button interactions
  • Text - Text content class
  • PushView - Interface for push notification views

Source: MarketingCloudSDK-Android JavaDocs