NotificationMessage

Package: com.salesforce.marketingcloud.notifications

Inheritance: Parcelable

A data class representing a notification message in the Salesforce Marketing Cloud SDK.

Declaration 

1data class NotificationMessage : Parcelable

Nested Types 

Sound 

1enum Sound : Enum<NotificationMessage.Sound>

Enumeration for notification sound types.

Trigger 

1enum Trigger : Enum<NotificationMessage.Trigger>

Enumeration for notification trigger types.

Type 

1enum Type : Enum<NotificationMessage.Type>

Enumeration for notification message types.


Properties 

alert 

1@JvmField
2val alert: String

The alert message text.

custom 

1@JvmField
2val custom: String?

Custom data associated with the notification (nullable).

customKeys 

1@JvmField
2val customKeys: Map<String, String>

A map of custom key-value pairs.

id 

1@JvmField
2val id: String

The unique identifier for the notification message.

mediaAltText 

1@JvmField
2val mediaAltText: String?

Alternative text for media content (nullable).

mediaUrl 

1@JvmField
2val mediaUrl: String?

URL for media content (nullable).

payload 

1@JvmField
2val payload: Map<String, String>?

Additional payload data as a map (nullable).

region 

1@JvmField
2val region: Region?

The geographic region associated with the notification (nullable).

requestId 

1@JvmField
2val requestId: String?

The request identifier (nullable).

richFeatures 

1@JvmField
2val richFeatures: RichFeatures?

Rich notification features (nullable).

sound 

1@JvmField
2val sound: NotificationMessage.Sound

The sound setting for the notification.

soundName 

1@JvmField
2val soundName: String?

The name of the custom sound file (nullable).

subtitle 

1@JvmField
2val subtitle: String?

The notification subtitle (nullable).

title 

1@JvmField
2val title: String?

The notification title (nullable).

trigger 

1@JvmField
2val trigger: NotificationMessage.Trigger

The trigger type for the notification.

type 

1@JvmField
2val type: NotificationMessage.Type

The type of notification message.

url 

1@JvmField
2val url: String?

URL associated with the notification (nullable).


Functions 

toJson 

1fun toJson(): JSONObject

Converts the notification message to a JSON object.

Returns: A JSONObject representation of the notification message.