Skip to main content

Content

AFCore.content() reads the member's personalized, content-managed surfaces -- bottom navigation, home banners and the Explore menu -- so your app's navigation and promotions can change from the CMS without an app release. Content comes localized, already filtered to what the member is entitled to, with typed actions and image URLs.

What you can do​

  • Build the bottom navigation from the member's configured tabs.
  • Show a home banner carousel with images cropped to a consistent shape, captions and calls to action.
  • Render the Explore menu as titled sections of cards, tiles and list rows.
  • Route every tap through a typed action or target: an in-app screen, a web page, a care path or a content entry.
  • Request content in a specific locale, such as es-US, or the member's default.

Key APIs​

CallWhat it is for
content().getToolbar(locale)Bottom navigation tabs (ContentPage)
content().getBanners(locale)Home banner slides (ContentPage)
content().getMenu(locale)The Explore menu page (ContentMenuPage), or null
content().getContent(placement, surfaceCode, locale)Any placement and surface
ContentMedia.url(rendition)An image URL in the rendition you need, such as CARD or BANNER_16X9

Example​

val slides = AFCore.content().getBanners(locale = null).items
slides.forEach { slide ->
addSlide(
imageUrl = slide.bannerMedia?.url(ContentImageRendition.BANNER_16X9),
caption = slide.overlayCaption,
link = slide.actionUrl,
)
}

val menu = AFCore.content().getMenu(locale = null) ?: return
menu.sections.forEach { section ->
section.entries.forEach { entry ->
when (entry.target?.kind) {
ContentTargetKind.INTERNAL_ROUTE -> addTile(entry.label) { navigate(entry.target?.routeKey) }
ContentTargetKind.EXTERNAL_URL -> addTile(entry.label) { openWeb(entry.target?.url) }
else -> Unit
}
}
}

Good to know​

  • An empty page (or a null menu) means "show nothing" -- never fall back to showing every feature. A failed read throws AFException; show an error with a retry.
  • Images are public: load them without an Authorization header.
  • userInterface() (getBottomNavigationItems(), getMenuItems(), getBannerImages(), tray notifications) keeps working unchanged, so you can move one surface at a time. Tray notifications stay on userInterface().

Learn more​

See the API Reference for ContentItem, ContentMenuPage and ContentTarget. Complete integration guides are in AIDE Docs.