Card

open class Card constructor(jsonObject: JSONObject, cardKeysProvider: CardKey.Provider, brazeManager: IBrazeManager?, cardStorage: ICardStorageProvider<*>?, cardAnalytics: ICardAnalyticsProvider?) : IPutIntoJson<JSONObject?>

Creates a card.

Parameters

jsonObject

JSON representation of the card

cardKeysProvider

The CardKey.Provider responsible for providing the appropriate key for a field.

brazeManager

Allows the card to report clicks internally

cardStorage

Allows the card to persist its viewed/unviewed state

Throws

When the provided JSON object is malformed

Constructors

Card
Link copied to clipboard
fun Card(jsonObject: JSONObject, cardKeyProvider: CardKey.Provider)
Card
Link copied to clipboard
fun Card(jsonObject: JSONObject, cardKeysProvider: CardKey.Provider, brazeManager: IBrazeManager?, cardStorage: ICardStorageProvider<*>?, cardAnalytics: ICardAnalyticsProvider?)
JSON representation of the card

Types

Companion
Link copied to clipboard
object Companion

Functions

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Compares against another Card instance.
forJsonPut
Link copied to clipboard
open override fun forJsonPut(): JSONObject
The JSONObject representation of this card.
hashCode
Link copied to clipboard
open override fun hashCode(): Int
isInCategorySet
Link copied to clipboard
fun isInCategorySet(categories: EnumSet<CardCategory>): Boolean
isValidCard
Link copied to clipboard
fun isValidCard(): Boolean
logClick
Link copied to clipboard
fun logClick(): Boolean
Reports this card was clicked.
logImpression
Link copied to clipboard
fun logImpression(): Boolean
Reports that this card was displayed to the user.
toString
Link copied to clipboard
open override fun toString(): String

Properties

brazeManager
Link copied to clipboard
private val brazeManager: IBrazeManager?
Allows the card to report clicks internally
cardAnalytics
Link copied to clipboard
private val cardAnalytics: ICardAnalyticsProvider?
cardStorage
Link copied to clipboard
private val cardStorage: ICardStorageProvider<*>?
Allows the card to persist its viewed/unviewed state
cardType
Link copied to clipboard
open val cardType: CardType
The CardType representing the type of this card or CardType.DEFAULT if the type is not known.
categories
Link copied to clipboard
var categories: EnumSet<CardCategory>? = null
The categories for this Feed card.
channel
Link copied to clipboard
val channel: Channel
created
Link copied to clipboard
val created: Long
The UNIX creation time of this Card, in seconds.
expiresAt
Link copied to clipboard
val expiresAt: Long
Gets the expiration date of the card.
extras
Link copied to clipboard
val extras: Map<String, String>
A map of key-value pair extras for this card.
id
Link copied to clipboard
val id: String
isClicked
Link copied to clipboard
var isClicked: Boolean
Gets the clicked state of this card.
isContentCard
Link copied to clipboard
val isContentCard: Boolean
isControl
Link copied to clipboard
val isControl: Boolean
Returns whether this card is a control card.
isDismissed
Link copied to clipboard
var isDismissed: Boolean
Indicates if this card is dismissed.
isDismissedInternal
Link copied to clipboard
private var isDismissedInternal: Boolean
isDismissibleByUser
Link copied to clipboard
var isDismissibleByUser: Boolean
True if this card is dismissible by the user, false otherwise.
isExpired
Link copied to clipboard
val isExpired: Boolean
True if this card's expiration date has already passed.
isIndicatorHighlighted
Link copied to clipboard
var isIndicatorHighlighted: Boolean
The current status of visual indicator at the bottom of the card highlight state.
isIndicatorHighlightedInternal
Link copied to clipboard
private var isIndicatorHighlightedInternal: Boolean
isPinned
Link copied to clipboard
var isPinned: Boolean
Whether this card is pinned.
isRemoved
Link copied to clipboard
val isRemoved: Boolean
True if this card was marked as removed, false otherwise.
isTest
Link copied to clipboard
var isTest: Boolean
Whether this Card arrived from a Braze Dashboard test send.
jsonObject
Link copied to clipboard
private val jsonObject: JSONObject
JSON representation of the card
listener
Link copied to clipboard
var listener: ICardListener? = null
The ICardListener that gets called when isIndicatorHighlighted is set.
openUriInWebView
Link copied to clipboard
val openUriInWebView: Boolean
Whether Uris for this card should be opened in Braze's WebView or not.
updated
Link copied to clipboard
val updated: Long
The UNIX last update time of this Card, in seconds.
url
Link copied to clipboard
open val url: String? = null
The url string associated with the card click action or null if not implemented by child class.
viewed
Link copied to clipboard
var viewed: Boolean
Whether this card has had its impression logged already.
wasViewedInternal
Link copied to clipboard
private var wasViewedInternal: Boolean

Inheritors

BannerImageCard
Link copied to clipboard
CaptionedImageCard
Link copied to clipboard
ControlCard
Link copied to clipboard
ShortNewsCard
Link copied to clipboard
TextAnnouncementCard
Link copied to clipboard