ContentCardUIProvider
Messaging extension implementation of AepUIContentProvider. ContentCardUIProvider fetches and manages content for a given surface and exposes card lists through getContentCardUIFlow. When you render cards with ContentCardEventObserver and pass this provider as the optional second argument, the same flow can emit updated lists after interactions (for example dismiss) without calling refreshContent.
Methods
getContentCardUIFlow
Retrieves a Flow of Result containing AepUI instances for the given surface, which only emits values when there is an active collector. Content is fetched lazily when the flow is collected. The flow continues to emit updates when refreshContent is called or when card UI events are processed via ContentCardEventObserver.
Returns
A Flow that emits a Result containing a list of AepUI instances.
Syntax
Copied to your clipboardfun getContentCardUIFlow(): Flow<Result<List<AepUI<*, *>>>>
getContentCardUI (Deprecated)
Deprecated — use getContentCardUIFlow instead. This suspend overload 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<*, *>>>>
refreshContent
Fetches the latest content cards for the given surface and pushes the update to all active collectors of getContentCardUIFlow.
Syntax
Copied to your clipboardoverride suspend fun refreshContent()
getUIContent
Retrieves a Flow of Result containing AepUITemplate instances for the given surface, which only emit values when there is an active collector.. Content is fetched lazily when the flow is collected. The flow continues to emit updates when refreshContent is called.
Prefer getContentCardUIFlow when rendering with Compose UI components, as it emits AepUI instances ready for use with card composables.
Returns
A Flow that emits a Result containing a list of AepUITemplate instances.
Syntax
Copied to your clipboardoverride fun getUIContent(): Flow<Result<List<AepUITemplate>>>
getContent (Deprecated)
Deprecated — use getUIContent instead. This suspend overload 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 getUIContent instead", ReplaceWith("getUIContent"))override suspend fun getContent(): Flow<Result<List<AepUITemplate>>>

