Edit in GitHubLog an issue

MessagingInboxProvider

Messaging extension implementation of AepInboxContentProvider. MessagingInboxProvider is responsible for fetching the Inbox content for a given surface and managing the Inbox state through reactive updates when the content needs to be refreshed.

Constructor

Copied to your clipboard
MessagingInboxProvider(surface: Surface)

Parameters

ParameterTypeDescription
surface
The surface to fetch inbox content for.

Methods

getInboxUI

Retrieves the Inbox content and updates the state as a flow. This method automatically loads initial content when first collected.

Returns

A Flow of InboxUIState representing the current state of the inbox.

Syntax

Copied to your clipboard
override fun getInboxUI(): Flow<InboxUIState>

refresh

Refreshes the Inbox content by fetching new inbox and content cards propositions from the device cache and updating the flow returned by getInboxUI. This will cause all collectors of the flow to receive the updated inbox.

Emits InboxUIState.Loading before fetching, then emits InboxUIState.Success or InboxUIState.Error.

Syntax

Copied to your clipboard
override suspend fun refresh()

Usage Example

Copied to your clipboard
class InboxViewModel : ViewModel() {
private val inboxProvider = MessagingInboxProvider(Surface("inbox"))
val inboxUIState: StateFlow<InboxUIState> = inboxProvider.getInboxUI()
.stateIn(
scope = viewModelScope,
started = SharingStarted.WhileSubscribed(5000),
initialValue = InboxUIState.Loading
)
fun refresh() {
viewModelScope.launch {
inboxProvider.refresh()
}
}
}
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2026 Adobe. All rights reserved.