MoECardHelper

Helper class to interact with the cards feature.

Since

1.0.0

Author

Umang Chamaria

Functions

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.

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.

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.

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.

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)
Link copied to clipboard
fun fetchCards(context: Context, listener: CardAvailableListener)
fun fetchCards(context: Context, appId: String, listener: CardAvailableListener)

Fetches the latest cards from the server and returns all active cards in the listener

Link copied to clipboard

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.

Link copied to clipboard

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

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

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

Link copied to clipboard

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

Fetches all cards related data for the given account.

Link copied to clipboard

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

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

Link copied to clipboard

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

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

Link copied to clipboard

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

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

Link copied to clipboard

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

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

Link copied to clipboard

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

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

Link copied to clipboard

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.

Link copied to clipboard

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.

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.

Link copied to clipboard

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

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