Content

interface Content

Personalized content - bottom navigation, banners and the Explore / Menu page - read directly from the ContentApi.

This is the content-managed successor of the Mobile API's userInterface() reads. Both keep working side by side: userInterface().getBottomNavigationItems(), getMenuItems(), getBannerImages() and the tray notifications still read the Mobile API unchanged, so an app can move one surface at a time.

What changes compared with userInterface()

Caching

Every read revalidates with the server using the content's ETag, so an unchanged placement costs one empty 304 round-trip. The cache is dropped on logout.

Empty content

The ContentApi answers an empty list both when nothing is configured and when it could not resolve the member's content; an empty page means "render nothing", not "confirmed empty". Transport and HTTP failures throw.

Kotlin

val tabs = AFCore.content().getToolbar(locale = null).items
val menu = AFCore.content().getMenu(locale = "es-US")

Swift

let tabs = try await AFCore.shared.content().getToolbar(locale: nil).items
let menu = try await AFCore.shared.content().getMenu(locale: "es-US")

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract suspend fun getBanners(locale: String? = null): ContentPage

The home-screen banner slides (at most twenty).

Link copied to clipboard
abstract suspend fun getContent(placement: ContentPlacement, surfaceCode: String = DEFAULT_SURFACE, locale: String? = null): ContentPage

The raw content of any placement and surfaceCode - the escape hatch for surfaces newer than this SDK's typed reads.

Link copied to clipboard
abstract suspend fun getMenu(locale: String? = null): ContentMenuPage?

The Explore / Menu page, or null when the server returned no menu page (see "Empty content" above) or one this SDK cannot read.

Link copied to clipboard
abstract suspend fun getToolbar(locale: String? = null): ContentPage

The bottom-navigation tabs (at most five).