Cards Data Payload

SyncCompleteData

TypeScript
/**
 * Data on API sync complete.
 */
class SyncCompleteData {

    /**
     * Indicating if there were any updates in the cards post sync. true if there are any new
     * updates present else false. This value is true even if card(s) are deleted.
     */
    hasUpdates: boolean;

    /**
     * Condition under which sync was triggered. Refer to {@link SyncType}
     */
    syncType: SyncType;
}

CardInfo

TypeScript
/**
 * All data for cards.
 */
 class CardInfo {

    /**
     * True if showing ALL tabs is enabled else false.
     */
    shouldShowAllTab: boolean;

    /**
     * All configured categories for cards.
     */
    categories: Array<string>;

    /**
     * All cards which are eligible for display currently.
     */
    cards: Array<Card>;
}

Card

TypeScript
/**
 * Card data
 */
class Card {

    /**
     * Internal SDK identifier.
     */
    id: number;

    /**
     * Unique identifier for the campaign
     */
    cardId: string;

    /**
     * Category to which the campaign belongs.
     */
    category: string;

    /**
     * Template payload for the campaign.
     */
    template: Template;

    /**
     * Meta data related to the campaign like status, delivery control etc.
     */
    metaData: MetaData;
}

Template

TypeScript
/**
 * Card Template data
 */
 class Template {

    /**
     * Type of Template.
     */
    templateType: TemplateType;

    /**
     * Containers in the template.
     */
    containers: Array<Container>;

    /**
     * Additional data associated to the template
     */
    kvPairs: { [k: string]: any };
}

TemplateType

TypeScript
/**
 * Supported template types.
 */
 enum TemplateType {

    /**
     * Basic Template
     */
    BASIC,

    /**
     * Illustration Template
     */
    ILLUSTRATION
}

Container

TypeScript
/**
 * Container to hold UI widget
 */
 class Container {

    /**
     * Unique identifier for a template
     */
    id: number;

    /**
     * Type of container.
     */
    templateType: TemplateType;

    /**
     * Style associated to the Container
     */
    style: ContainerStyle | undefined;

    /**
     * Widget list associated to the Container
     */
    widgets: Array<Widget>;

    /**
     * Actions to be performed on widget click
     */
    actionList: Array<Action>;
}

Widget

TypeScript
/**
 * UI element in a card.
 */
 class Widget {

    /**
     * Identifier for the widget.
     */
    id: number;

    /**
     * Type of widget
     */
    widgetType: WidgetType;

    /**
     * Content to be loaded in the widget.
     */
    content: string;

    /**
     * Style associated with the widget
     */
    style: WidgetStyle | undefined;

    /**
     * Actions to be performed on widget click
     */
    actionList: Array<Action>;
}

WidgetType

TypeScript
/**
 * Types of UI widgets supported.
 */
enum WidgetType {

    /**
     * Widget that loads an image or gif
     */
    IMAGE,

    /**
     * Widget that loads text content.
     */
    TEXT,

    /**
     * Widget that loads button content.
     */
    BUTTON
}

MetaData

TypeScript
/**
 * Meta data related to a campaign.
 */
class MetaData {

    /**
     * True if the campaign should be pinned to the top else false.
     */
    isPinned: boolean;

    /**
     * True if the campaign hasn't been delivered to the inbox, else false.
     */
    isNewCard: boolean;

    /**
     * Current state of the campaign.
     */
    campaignState: CampaignState;

    /**
     * Time at which the campaign would be deleted from local store
*/ deletionTime: number; /** * Delivery Controls defined during campaign creation. */ displayControl: DisplayControl; /** * Additional meta data regarding campaign used for tracking purposes. */ metaData: { [k: string]: any }; /** * Creation time for the campaign. * Notes: Available in iOS, default value is -1 */ createdAt: number; /** * Last time the campaign was updated. */ updatedTime: number; /** * Complete Campaign payload. */ campaignPayload: { [k: string]: any }; }

CardsData

TypeScript
/**
 * Data for cards
 */
class CardsData {

    /**
     * Category for the cards
     */
    category: string;

    /**
     * [List] of [Card]
     */
    cards: Array<Card>;
}

SyncType

TypeScript
/**
 * Condition/Situation when sync
 */
enum SyncType {

    /**
     * Sync when application comes to foreground
     */
    APP_OPEN,

    /**
     * Sync when inbox screen opened.
     */
    INBOX_OPEN,

    /**
     * Sync when SwipeToRefresh widget is pulled.
     */
    PULL_TO_REFRESH
/** * Sync when user logs in * @since 5.0.0 */ IMMEDIATE }

Previous

Next

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?