MoECardHelper

object MoECardHelper

Helper class to interact with the cards feature.

Since

1.0.0

Author

Umang Chamaria

Functions

cardClicked
Link copied to clipboard
fun cardClicked(context: Context, card: Card, widgetId: Int)

Marks a card as clicked and tracks an event for statistical purpose for the instance configured as default.

fun cardClicked(context: Context, card: Card, widgetId: Int, appId: String)

Marks a card as clicked and tracks an event for statistical purpose for the given instance.

cardDelivered
Link copied to clipboard
fun cardDelivered(context: Context)

Tracking card delivery to inbox for the account configured as default.

fun cardDelivered(context: Context, appId: String)

Tracking card delivery to inbox for the given account.

cardShown
Link copied to clipboard
fun cardShown(context: Context, card: Card)

Track cards shown and update delivery counters accordingly for the account configured as default.

fun cardShown(context: Context, card: Card, appId: String)

S Track cards shown and update delivery counters accordingly for the given account.

deleteCard
Link copied to clipboard
fun deleteCard(context: Context, card: Card)

Deletes the given card in the instance configured as the default instance.

fun deleteCard(context: Context, card: Card, appId: String)

Deletes the given card in the given account.

deleteCards
Link copied to clipboard
fun deleteCards(context: Context, cards: List<Card>)

Deletes the List of Card in the default instance.

fun deleteCards(context: Context, cards: List<Card>, appId: String)
getCardCategories
Link copied to clipboard
fun getCardCategories(context: Context): List<String>

Returns a list of categories to be shown for the account configured as the default instance.

fun getCardCategories(context: Context, appId: String): List<String>

Returns a list of categories to be shown for the given instance.

getCardsForCategory
Link copied to clipboard
fun getCardsForCategory(context: Context, category: String): CardData?

Returns all eligible cards for the given category for the instance configured as default or null if no account is configured as default. To fetch all cards irrespective of categories pass in the category as CARDS_CATEGORY_ALL

fun getCardsForCategory(context: Context, category: String, appId: String): CardData?

Returns a list of eligible cards for the given category or null if the given account is not configured. To fetch all cards irrespective of categories pass in the category as CARDS_CATEGORY_ALL

getCardsForCategoryAsync
Link copied to clipboard
fun getCardsForCategoryAsync(context: Context, category: String, listener: CardAvailableListener)

Returns a list of eligible cards to the listener for the instance configured as default. To fetch all cards irrespective of categories pass in the category as CARDS_CATEGORY_ALL

fun getCardsForCategoryAsync(context: Context, category: String, appId: String, listener: CardAvailableListener)

Returns a list of eligible cards to the listener for the given account. To fetch all cards irrespective of categories pass in the category as CARDS_CATEGORY_ALL

getCardsInfo
Link copied to clipboard
fun getCardsInfo(context: Context): CardInfo?

Fetches all cards related data for the account configured as default.

fun getCardsInfo(context: Context, appId: String): CardInfo?

Fetches all cards related data for the given account.

getNewCardCount
Link copied to clipboard
fun getNewCardCount(context: Context): NewCardCountData?

Returns the count of new cards available for the account configured as default or null if no account is configured as default.

fun getNewCardCount(context: Context, appId: String): NewCardCountData?

Returns the count of new cards available for the given account.

getNewCardCountAsync
Link copied to clipboard
fun getNewCardCountAsync(context: Context, listener: NewCardCountAvailableListener)

Returns the count of new cards in the listener for the account configured as default.

fun getNewCardCountAsync(context: Context, appId: String, listener: NewCardCountAvailableListener)

Returns the count of new cards to the listener for the given account.

getUnClickedCardCount
Link copied to clipboard
fun getUnClickedCardCount(context: Context): UnClickedCountData?

Returns the count of un-clicked cards for the account configured as default instance or null if default instance is not configured.

fun getUnClickedCardCount(context: Context, appId: String): UnClickedCountData?

Returns the count of un-clicked cards for the given account or null if the account is not configured.

getUnClickedCardCountAsync
Link copied to clipboard
fun getUnClickedCardCountAsync(context: Context, listener: UnClickedCountListener)

Returns the count of un-clicked cards in the listener for the account configured as default.

fun getUnClickedCardCountAsync(context: Context, appId: String, listener: UnClickedCountListener)

Returns the count of un-clicked cards in the listener for the given account.

isAllCategoryEnabled
Link copied to clipboard
fun isAllCategoryEnabled(context: Context): Boolean

Return true if All cards category should be shown for account configured as default.

fun isAllCategoryEnabled(context: Context, appId: String): Boolean

Return true if All cards category should be shown for the given account.

onCardSectionLoaded
Link copied to clipboard
fun onCardSectionLoaded(context: Context, listener: SyncCompleteListener)

Notify the MoEngage SDK that card section has loaded for the instance configured as default instance.

fun onCardSectionLoaded(context: Context, appId: String, listener: SyncCompleteListener)

Notify the MoEngage SDK that card section has loaded for the given account.

onCardSectionUnloaded
Link copied to clipboard
fun onCardSectionUnloaded(context: Context)

Notifies the SDK that the inbox view is gone to the background for the account configured as the default instance.

fun onCardSectionUnloaded(context: Context, appId: String)

Notifies the SDK that the inbox view is gone to the background for the given account.

refreshCards
Link copied to clipboard
fun refreshCards(context: Context, listener: SyncCompleteListener)

Ask the SDK to refresh cards on user request for the account configured as default.

fun refreshCards(context: Context, appId: String, listener: SyncCompleteListener)

Ask the SDK to refresh cards on user request for the given account.

setSyncCompleteListener
Link copied to clipboard
fun setSyncCompleteListener(listener: SyncCompleteListener?)

Set a listener to receive callback for cards refresh on App open for the account configured as default.

fun setSyncCompleteListener(appId: String, listener: SyncCompleteListener?)

Set a listener to receive callback for cards refresh on App open for the given instance.