PropositionItem
The PropositionItem
class represents the decision proposition item received from the remote, upon a personalization query to the Experience Edge network.
iOS Interface - PropositionItem
Public variables
itemId
Unique proposition item identifier.
Copied to your clipboardpublic let itemId: String
itemData
Proposition item data as dictionary.
Copied to your clipboardpublic let itemData: [String: Any]
schema
Proposition item schema string.
Copied to your clipboardpublic let schema: String
htmlContent
Returns item data content as a string if the proposition item schema is htmlContent
, otherwise returns nil
.
Copied to your clipboardvar htmlContent: String?
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]?
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]?
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 - PropositionItem
Public functions
getItemId
Returns this proposition item's unique identifier as a string.
getItemData
Returns this proposition's unique identifier as a string.
getSchema
Returns this proposition item's content schema as a string.
getHtmlContent
Returns item data content as a string if the proposition item schema is HTML_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.
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.
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.
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.