DigitalFlyer

data class DigitalFlyer(val subscriptionKey: String, val client: String, val banner: String = client, val environment: Environment = Environment.LIVE, bannerId: String? = null)

The entry-point for interacting with the SDK.

The DigitalFlyer is used in order to retrieve Publications from the server.

import com.tctranscontinental.android.digitalflyer.DigitalFlyer

val digitalFlyer = DigitalFlyer(
subscriptionKey = subscriptionKey,
client = client,
banner = banner,
environment = environment
)

val publications = digitalFlyer.listPublications(
storeId = storeId,
language = language,
date = date
)

val publication = digitalFlyer.getPublication(
attributes = attributes,
orientation = FlyerLayout.VERTICAL
)

While it’s technically possible to instantiate multiple DigitalFlyer objects with the same inputs on-demand, it’s recommended to use a single instance throughout your application (e.g. a reference in your Application class).

Instantiating multiple DigitalFlyer objects with different inputs is not currently supported. It will result in undefined behavior.

Parameters

subscriptionKey

The subscription key, as provided by TC, associated with the application

client

The client's name, as provided by TC, associated with this instance

banner

The banner, as provided by TC, associated with this instance

environment

The API Environment associated with this instance

Throws

if the subscription key is an empty string.

if the client is an empty string.

if the banner is an empty string.

Constructors

Link copied to clipboard
constructor(subscriptionKey: String, client: String, banner: String = client, environment: Environment = Environment.LIVE, bannerId: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun getPublication(attributes: Publication.Attributes, orientation: Orientation): Publication

Retrieve the full Publication, including attributes and page content.

suspend fun getPublication(attributes: Publication.Attributes, orientation: Orientation, filters: FilterOptions, aspectRatio: Double): Publication?
Link copied to clipboard
suspend fun listFilters(attributes: Publication.Attributes): Filters

Retrieves a list of categories with their subcategories.

Link copied to clipboard
suspend fun listPublications(storeId: String, language: Language = Language.ENGLISH, date: LocalDate = LocalDate.now()): List<Publication.Attributes>

Retrieve a list of all active publications.