Edit in GitHubLog an issue

API Reference

This document lists the public APIs available in the Messaging extension for implementing Inbox UI with qualified content cards.

Importing Messaging

To use the Messaging APIs, import the Messaging module in your Swift file.

Copied to your clipboard
import AEPMessaging

getInboxUI

The getInboxUI method obtains an InboxUI instance for a given surface so you can display a SwiftUI Inbox view with the qualified content cards.

Parameters:

  • surface - The Surface for which to retrieve the inbox.
  • customizer - An optional ContentCardCustomizing object to customize the appearance of the content cards within the inbox. If you do not need to customize the appearance of the content cards, this parameter can be omitted.
  • listener - An optional InboxEventListening object to listen to state and interaction events from the inbox. If you do not need to listen to events, this parameter can be omitted.

Syntax

Copied to your clipboard
@available(iOS 15.0, *)
public static func getInboxUI(for surface: Surface,
customizer: ContentCardCustomizing? = nil,
listener: InboxEventListening? = nil) -> InboxUI

Example

Copied to your clipboard
// Create a surface matching your Adobe Journey Optimizer campaign configuration
let inboxSurface = Surface(path: "inbox")
// Get the InboxUI instance
let inboxUI = Messaging.getInboxUI(for: inboxSurface)
// Display the inbox view in SwiftUI
struct InboxPage: View {
var body: some View {
inboxUI.view
.onAppear {
Messaging.updatePropositionsForSurfaces([inboxSurface])
}
}
}

Example with listener and customizer

Copied to your clipboard
let inboxSurface = Surface(path: "inbox")
let inboxUI = Messaging.getInboxUI(
for: inboxSurface,
customizer: MyCardCustomizer(),
listener: self
)

Typical Usage Flow

  1. Register and configure the AEPMessaging extension at app launch.
  2. Call updatePropositionsForSurfaces to download inbox content.
  3. Call Messaging.getInboxUI(for:) to obtain an InboxUI instance.
  4. Display the inbox using the InboxUI.view property in your SwiftUI or UIKit view.
  5. Optionally assign a listener and customizer to respond to events and style the inbox.
Copied to your clipboard
import SwiftUI
import AEPMessaging
struct InboxPage: View {
let inboxUI: InboxUI
init() {
let surface = Surface(path: "inbox")
inboxUI = Messaging.getInboxUI(for: surface)
inboxUI.isPullToRefreshEnabled = true
}
var body: some View {
NavigationView {
inboxUI.view
.navigationTitle("Inbox")
}
.onAppear {
Messaging.updatePropositionsForSurfaces([Surface(path: "inbox")])
}
}
}

Next Steps

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2026 Adobe. All rights reserved.