RichButtonTemplate
RichButton
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
Package: com.salesforce.marketingcloud.pushmodels.rich.buttons
Module: Push Models Module v1.0.2
Hierarchy: RichButtonTemplate > 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, PushViewA data class representing a rich button component in the Salesforce Marketing Cloud Unified SDK. This class implements Parcelable for Android serialization and PushView for view representation.
1constructor(
2 identifier: String,
3 title: Text? = null,
4 icon: String? = null,
5 style: Style? = null,
6 actions: List<Action>? = listOf(Action.OpenApp)
7)Creates a new RichButton instance with the specified parameters.
1val identifier: StringUnique identifier for the button.
1val title: Text?Optional text content for the button.
1val icon: String?Optional icon resource identifier.
1open override val style: Style?Optional styling configuration (overrides PushView).
1open override val actions: List<Action>?List of actions to execute when the button is pressed. Defaults to listOf(Action.OpenApp) (overrides PushView).
1fun toJson(): JSONObjectConverts the RichButton instance to a JSON object representation.
Returns: JSONObject containing the serialized button data.
1open override fun toString(): StringReturns a string representation of the RichButton instance.
Returns: String representation of the object.