Edit in GitHubLog an issue

API Reference

This document provides information on how to use the Messaging APIs to receive and display content card views in your application.

getContentCardUIFlow

The getContentCardUIFlow method returns a cold Flow of AepUI objects for the provided surface. These AepUI objects represent templated content cards whose UI can be rendered using provided card composables. Content is fetched lazily when the flow is collected.

Syntax

Copied to your clipboard
fun getContentCardUIFlow(): Flow<Result<List<AepUI<*, *>>>>

Example

Copied to your clipboard
// Download the content cards for homepage surface using Messaging extension
val surfaces = mutableListOf<Surface>()
val surface = Surface("homepage")
surfaces.add(surface)
Messaging.updatePropositionsForSurfaces(surfaces)
// Initialize the ContentCardUIProvider
val contentCardUIProvider = ContentCardUIProvider(surface)
// get the content cards within a view model
class MyScreenViewModel : ViewModel() {
private val contentCardUIProvider = ContentCardUIProvider(surface)
private val _aepUIList = MutableStateFlow<List<AepUI<*, *>>>(emptyList())
val aepUIList: StateFlow<List<AepUI<*, *>>> = _aepUIList.asStateFlow()
// Obtain the flow without a coroutine context, then collect it
val contentCardFlow = contentCardUIProvider.getContentCardUIFlow()
init {
viewModelScope.launch {
contentCardFlow.collect { result ->
result.onSuccess { aepUi -> _aepUIList.value = aepUi }
}
}
}
}

getContentCardUI (Deprecated)

The getContentCardUI suspend function is retained for binary compatibility with apps built against earlier releases. It eagerly fetches content before returning the flow and requires a coroutine call site to obtain the flow reference.

Syntax

Copied to your clipboard
@Deprecated("Use getContentCardUIFlow() instead.")
suspend fun getContentCardUI(): Flow<Result<List<AepUI<*, *>>>>
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2026 Adobe. All rights reserved.