Edit in GitHubLog an issue

API Reference

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

getContentCardUI

The getContentCardUI method retrieves a flow of AepUI objects for the provided surface. These AepUI objects represent templated content cards whose UI can be rendered using provided card composables.

Syntax

Copied to your clipboard
suspend fun getContentCardUI(): Flow<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 = MessagingContentCardProvider(...)
private val _aepUIList = MutableStateFlow<List<AepUI<*, *>>>(emptyList())
val aepUIList: StateFlow<List<AepUI<*, *>>> = _aepUIList.asStateFlow()
// fetch the list of cards when necessary
viewModelScope.launch {
contentCardUIProvider.getContentCardUI().collect {
aepUi ->
_aepUIList.value = aepUi
}
}
}
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2025 Adobe. All rights reserved.