PropositionItem
The PropositionItem
class represents the decision proposition item received from the remote, upon a personalization query to the Experience Edge network.
iOS Interface
Public variables
contentCardSchemaData
Decodes and returns item data content as an ContentCardSchemaData object.
Returns nil
if decoding fails or if the proposition item schema is not .contentCard
.
Copied to your clipboardvar contentCardSchemaData: ContentCardSchemaData?
htmlContent
Returns item data content as a string if the proposition item schema is htmlContent
, otherwise returns nil
.
Copied to your clipboardvar htmlContent: String?
inappSchemaData
Decodes and returns item data content as an InAppSchemaData object.
Returns nil
if decoding fails or if the proposition item schema is not .inApp
.
Copied to your clipboardvar inappSchemaData: InAppSchemaData?
itemData
Proposition item data as dictionary.
Copied to your clipboardpublic let itemData: [String: Any]
itemId
Unique proposition item identifier.
Copied to your clipboardpublic let itemId: String
jsonContentArray
Returns item data content as an array if it can be parsed as an array and if the proposition item schema is jsonContent
, otherwise returns nil
.
Copied to your clipboardvar jsonContentArray: [Any]?
jsonContentDictionary
Returns item data content as a dictionary if it can be parsed as a dictionary and if the proposition item schema is jsonContent
, otherwise returns nil
.
Copied to your clipboardvar jsonContentDictionary: [String: Any]?
schema
Proposition item schema string.
Copied to your clipboardpublic let schema: String
Public functions
generateInteractionXdm
Returns a dictionary containing XDM data for interaction with the given proposition item, for the provided event type.
iOS
Swift
Syntax
Copied to your clipboardfunc generateInteractionXdm(_ interaction: String? = nil, withEdgeEventType eventType: MessagingEdgeEventType, forTokens tokens: [String]? = nil) -> [String: Any]?
- interaction is a custom string value describing the interaction.
- eventType is an enum specifying event type for the interaction.
- tokens is an array containing the decision item tokens for recording interaction.
Swift
Syntax
Copied to your clipboardfunc generateInteractionXdm(_ interaction: String? = nil, withEdgeEventType eventType: MessagingEdgeEventType, forTokens tokens: [String]? = nil) -> [String: Any]?
- interaction is a custom string value describing the interaction.
- eventType is an enum specifying event type for the interaction.
- tokens is an array containing the decision item tokens for recording interaction.
track
Tracks interaction with the given proposition item.
iOS
Swift
Syntax
Copied to your clipboardfunc track(_ interaction: String? = nil, withEdgeEventType eventType: MessagingEdgeEventType, forTokens tokens: [String]? = nil)
- interaction is a custom string value describing the interaction.
- eventType is an enum specifying event type for the interaction.
- tokens is an array containing the decision item tokens for recording interaction.
Swift
Syntax
Copied to your clipboardfunc track(_ interaction: String? = nil, withEdgeEventType eventType: MessagingEdgeEventType, forTokens tokens: [String]? = nil)
- interaction is a custom string value describing the interaction.
- eventType is an enum specifying event type for the interaction.
- tokens is an array containing the decision item tokens for recording interaction.
Android Interface
Public functions
generateInteractionXdm
Returns a Map containing XDM data for interaction with the given proposition item, for the provided event type.
generateInteractionXdm
Returns a Map containing XDM data for interaction with the given proposition item, for the provided event type and decision item tokens.
Android
Java
Syntax
Copied to your clipboardpublic Map<String, Object> generateInteractionXdm(final String interaction, @NonNull final MessagingEdgeEventType eventType, final List<String> tokens)
- interaction is a custom string value describing the interaction.
- eventType is an enum specifying event type for the interaction.
- tokens is a list containing the decision item tokens for recording interaction.
Java
Syntax
Copied to your clipboardpublic Map<String, Object> generateInteractionXdm(final String interaction, @NonNull final MessagingEdgeEventType eventType, final List<String> tokens)
- interaction is a custom string value describing the interaction.
- eventType is an enum specifying event type for the interaction.
- tokens is a list containing the decision item tokens for recording interaction.
getContentCardSchemaData
Decodes and returns this proposition item's content schema as a ContentCardSchemaData, or null
if decoding fails.
getHtmlContent
Returns item data content as a string if the proposition item schema is HTML_CONTENT
, otherwise returns null.
getInAppSchemaData
Decodes and returns this proposition item's content schema as a InAppSchemaData, or null
if decoding fails.
getItemData
Returns this proposition's unique identifier as a string.
getItemId
Returns this proposition item's unique identifier as a string.
getJsonContentArrayList
Returns item data content as a list if it can be parsed as a list and if the proposition item schema is JSON_CONTENT
, otherwise returns null.
getJsonContentMap
Returns item data content as a Map if it can be parsed as a Map and if the proposition item schema is JSON_CONTENT
, otherwise returns null.
getSchema
Returns this proposition item's content schema as a string.
track
Tracks interaction with the given proposition item.
track
Tracks interaction with the given proposition item for the provided decision item tokens.
Android
Java
Syntax
Copied to your clipboardpublic void track(final String interaction, @NonNull final MessagingEdgeEventType eventType, final List<String> tokens)
- interaction is a custom string value describing the interaction.
- eventType is an enum specifying event type for the interaction.
- tokens is a list containing the decision item tokens for recording interaction.
Java
Syntax
Copied to your clipboardpublic void track(final String interaction, @NonNull final MessagingEdgeEventType eventType, final List<String> tokens)
- interaction is a custom string value describing the interaction.
- eventType is an enum specifying event type for the interaction.
- tokens is a list containing the decision item tokens for recording interaction.