Event

Package: com.salesforce.marketingcloud.sfmcsdk.components.events

Platform: androidJvm

SDK Version: 11.0.0

Description 

An abstract base class representing events in the Salesforce Marketing Cloud Unified SDK. This class provides the foundation for tracking and managing events within the SDK.

Declaration 

1abstract class Event

Inheritance 

Known Subclasses:

  • EngagementEvent

Constructors 

Event 

1constructor()

Default constructor for creating an Event instance.

Properties 

id 

1@JvmField
2val id: String

Unique identifier for the event.

category 

1open val category: Event.Category

The Event category name. See Category enum for allowed values.

producer 

1open val producer: Event.Producer

The Event producer name. See Producer enum for allowed values.

Methods 

name 

1abstract fun name(): String

Returns: The event name as a String

Description: The name for the event. This value must match the Event Name used when creating the event in the Marketing Cloud UI.

attributes 

1abstract fun attributes(): Map<String, Any>

Returns: A map of attribute key-value pairs

Description: The Event attributes for this event.

toJson 

1fun toJson(): JSONObject

Returns: A JSONObject representation of the event

Description: Converts the event to JSON format.

track 

1fun track()

Description: Method to track this Event via EventManager to subscriber EventSubscriber.

Nested Types 

Category 

1enum Category : Enum<Event.Category>

List of possible Category values for sending Events.

Enum Values 

ConstantDescription
APPLICATIONCategory for application-related events
ENGAGEMENTCategory for engagement-related events
IDENTITYCategory for identity-related events
SYSTEMCategory for system-related events
BILLINGCategory for billing-related events
CUSTOMCategory for custom events

Properties 

  • entries: EnumEntries<Event.Category> - Returns an immutable list representation of all enum entries in declaration order

Methods 

  • valueOf(value: String): Event.Category - Returns the enum constant matching the specified name
  • values(): Array<Event.Category> - Returns an array containing all enum constants in declaration order

Producer 

1enum Producer : Enum<Event.Producer>

List of possible Producer values for sending Events.

Enum Values 

ConstantDescription
CUSTOMER_APPApplication-level producer
UNIFIED_SDKUnified SDK producer
MCE_MODULEMCE module producer
DC_MODULEDC module producer
MAM_MODULEMAM module producer
PUSH_FEATURE_MODULEPush feature module producer
IAM_FEATURE_MODULEIAM feature module producer

Properties 

  • entries: EnumEntries<Event.Producer> - Returns an immutable list representation of all enum entries in declaration order

Methods 

  • valueOf(value: String): Event.Producer - Returns the enum constant matching the specified name
  • values(): Array<Event.Producer> - Returns an array containing all enum constants in declaration order