Live activity integration with Adobe Experience Platform Mobile SDK mobile-live-config-sdk

On this page: Integrate the Adobe Experience Platform Mobile SDK into your iOS app so it can register, display, and receive real-time Live activity updates on the Lock Screen and Dynamic Island.

The Adobe Experience Platform Mobile SDK provides built-in support for Apple’s Live activities. This allows your app to display real-time, dynamic updates directly on the Lock Screen and Dynamic Island without opening the app.

  1. Import required modules

    Import the following modules: AEPMessaging, AEPMessagingLiveActivity, ActivityKit.

  2. Define attributes

    Conform to LiveActivityAttributes, include LiveActivityData and a ContentState attributes.

  3. Register Live activity

    Use Messaging.registerLiveActivity() after SDK initialization.

  4. Create widget configuration

    Implement ActivityConfiguration for both Lock Screen and Dynamic Island interface.

  5. Start a Live activity locally (optional)

    Live activity can be initiated either remotely through Journey Optimizer or locally within the application code.

  6. Add debug support (optional)

    Implement LiveActivityAssuranceDebuggable for Assurance.

Verify that the following minimum versions are installed to ensure correct configuration and compatibility.

Prerequisites:

  • iOS:

    • iOS16.1 or later: Basic Live activity functionality
    • iOS 17.2+: Push-to-start support
    • iOS 18+: Broadcast channel support
  • Xcode: 14.0 or later

  • Swift: 5.7 or later

  • Dependencies: AEPCore, AEPMessaging, AEPMessagingLiveActivity, ActivityKit

  • AEP Mobile SDK version: iOS Messaging 5.11.0 or later

Step 1: Import required modules import

To get started, you first need to import the following modules: AEPMessaging, AEPMessagingLiveActivity, ActivityKit.

import AEPMessaging
import AEPMessagingLiveActivity
import ActivityKit

Step 2: define your live activity attributes attributes

Create a struct that conforms to the LiveActivityAttributes protocol. This defines both the static data and dynamic content state for your Live activity.

The key components include:

  • liveActivityData (required) which contains Adobe Experience Platform-specific data.

    • For individual users: Use LiveActivityData(liveActivityID: "unique-id")
    • For broadcast: Use LiveActivityData(channelID: "channel-id")
  • Static Attributes, custom properties specific to your use case, e.g. restaurantName.

  • ContentState which defines dynamic data that can be updated during the Live activity lifecycle. It must conform to Codable and Hashable.

  • LiveActivityOrigin enumeration specifies whether an activity was initiated locally within the app or remotely via a push-to-start notification, supported in iOS 17.2 and later. This value allows the SDK to differentiate between locally initiated and remotely triggered Live activity during data collection.

Examples

@available(iOS 16.1, *)
struct FoodDeliveryLiveActivityAttributes: LiveActivityAttributes {
    // Mandatory: AEP Integration Data
    var liveActivityData: LiveActivityData

    // Static Attributes: Custom properties that do not change
    var restaurantName: String

    // Dynamic Content State: Data that can be updated
    struct ContentState: Codable, Hashable {
        var orderStatus: String
    }
}

@available(iOS 16.1, *)
public struct LiveActivityData: Codable {
    /// Unique identifier for broadcast Live activity channels
    public let channelID: String?

    /// Unique identifier for individual Live activity
    public let liveActivityID: String?

    /// Indicates local vs remote creation
    public let origin: LiveActivityOrigin?

    // Initializers
    public init(channelID: String)        // For broadcast Live activity
    public init(liveActivityID: String)   // For individual Live activity
}

You can also register multiple Live activity types for your app:

if #available(iOS 16.1, *) {
    Messaging.registerLiveActivity(AirplaneTrackingAttributes.self)
    Messaging.registerLiveActivity(FoodDeliveryLiveActivityAttributes.self)
    Messaging.registerLiveActivity(GameScoreLiveActivityAttributes.self)
}

Step 3: register live activity register

Register your Live activity types in your AppDelegate after SDK initialization, this allows you to:

  • Enables automatic push-to-start token collection (iOS 17.2+)
  • Automatically collects Live activity update tokens
  • Enables lifecycle management and event tracking

Example for a food delivery Live activity:

if #available(iOS 16.1, *) {
    Messaging.registerLiveActivity(FoodDeliveryLiveActivityAttributes.self)
}

Step 4: create live activity widgets widgets

A Live activity is displayed through widgets. You need to create a widget bundle and configuration:

Example for a food delivery Live activity:

@main
struct FoodDeliveryWidgetBundle: WidgetBundle {
    var body: some Widget {
        FoodDeliveryLiveActivityWidget()
    }
}

@available(iOS 16.1, *)
struct FoodDeliveryLiveActivityWidget: Widget {
    var body: some WidgetConfiguration {
        ActivityConfiguration(for: FoodDeliveryLiveActivityAttributes.self) { context in
            // Lock Screen UI
            VStack {
                Text("Order from \(context.attributes.restaurantName)")
                Text("Status: \(context.state.orderStatus)") // possible status may include "Ordered", "Order accepted", "Preparing", "On the Way","Delivered"
            }
        } dynamicIsland: { context in
            // Dynamic Island UI
            DynamicIsland {
                // Expanded UI
            } compactLeading: {
                // Compact leading UI
            } compactTrailing: {
                // Compact trailing UI
            } minimal: {
                // Minimal UI
            }
        }
    }
}

Step 5: start a live activity locally (optional) local

While Journey Optimizer can remotely start Live activities, you can also start them locally:

Example for a food delivery Live activity:

let attributes = FoodDeliveryLiveActivityAttributes(
    liveActivityData: LiveActivityData(liveActivityID: "order123"),
    restaurantName: "Pizza Palace"
)

let contentState = FoodDeliveryLiveActivityAttributes.ContentState(
    orderStatus: "Ordered"
)

let activity = try Activity<FoodDeliveryLiveActivityAttributes>.request(
    attributes: attributes,
    contentState: contentState,
    pushType: .token
)

Step 6: Add debug support (optional) debug

If needed, you can debug Live activity schemas in Adobe Assurance:

Example for a food delivery Live activity:

@available(iOS 16.1, *)
extension FoodDeliveryLiveActivityAttributes: LiveActivityAssuranceDebuggable {
    static func getDebugInfo() -> (attributes: FoodDeliveryLiveActivityAttributes, state: ContentState) {
        return (
            FoodDeliveryLiveActivityAttributes(
                liveActivityData: LiveActivityData(liveActivityID: "debug-order-123"),
                restaurantName: "Debug Restaurant"
            ),
            ContentState(orderStatus: "Ordered")
        )
    }
}

Additional resources

For comprehensive SDK documentation and implementation details:

TIP
If you are experiencing issues with token registration, payload alignment, or Live activity delivery, see Troubleshoot Live activities for detailed debugging guidance.
AI Knowledge Reference

This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.

For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.

  • TL;DR: This page explains how to integrate the Adobe Experience Platform Mobile SDK into an iOS app so it can register, display, and receive real-time Live activity updates on the Lock Screen and Dynamic Island.

Intents:

  • Import the required modules AEPMessaging, AEPMessagingLiveActivity, and ActivityKit
  • Define Live activity attributes conforming to LiveActivityAttributes, including LiveActivityData and a ContentState
  • Register Live activity types with Messaging.registerLiveActivity() after SDK initialization
  • Create a widget configuration (ActivityConfiguration) for both the Lock Screen and Dynamic Island
  • Optionally start a Live activity locally and add Assurance debug support

Glossary:

  • LiveActivityAttributes: The protocol a struct conforms to, defining both the static data and the dynamic content state for a Live activity (product-specific)
  • LiveActivityData: A required property containing Adobe Experience Platform-specific data; liveActivityID for individual users, channelID for broadcast (product-specific)
  • ContentState: Dynamic data that can be updated during the Live activity lifecycle; must conform to Codable and Hashable
  • LiveActivityOrigin: An enumeration specifying whether an activity was initiated locally or remotely via a push-to-start notification, supported in iOS 17.2 and later (product-specific)
  • Messaging.registerLiveActivity(): The call used after SDK initialization to register Live activity types (product-specific)
  • ActivityConfiguration: The widget configuration implemented for the Lock Screen and Dynamic Island interface
  • LiveActivityAssuranceDebuggable: The protocol implemented to debug Live activity schemas in Adobe Assurance (product-specific)

Guardrails:

  • iOS: 16.1 or later for basic Live activity functionality; 17.2 or later for push-to-start; 18 or later for broadcast channel support (minimum versions).
  • Xcode 14.0 or later (minimum version).
  • Swift 5.7 or later (minimum version).
  • AEP Mobile SDK: iOS Messaging 5.11.0 or later (minimum version).
  • Required dependencies: AEPCore, AEPMessaging, AEPMessagingLiveActivity, ActivityKit.
  • liveActivityData is required and contains Adobe Experience Platform-specific data; ContentState must conform to Codable and Hashable.

Terminology:

  • Canonical name: Adobe Experience Platform Mobile SDK — Acronym: AEP Mobile SDK — variants: Mobile SDK, messaging SDK
  • Synonyms: “push-to-start” = “remotely triggered start, supported in iOS 17.2 and later”
  • Do not confuse: “liveActivityID” (individual users) ≠ “channelID” (broadcast)
  • Do not confuse: “start a Live activity locally” (initiated within the application code) ≠ “start remotely via push-to-start” (triggered remotely through Journey Optimizer)

FAQ:

  • Q: Which modules must I import?AEPMessaging, AEPMessagingLiveActivity, and ActivityKit.
  • Q: What is the minimum iOS version? — iOS 16.1 or later for basic functionality; iOS 17.2 or later for push-to-start; iOS 18 or later for broadcast channel support.
  • Q: Which AEP Mobile SDK version is required? — iOS Messaging 5.11.0 or later.
  • Q: How do I register Live activity types? — Use Messaging.registerLiveActivity() in your AppDelegate after SDK initialization; you can register multiple Live activity types.
  • Q: Can I start a Live activity without Journey Optimizer? — Yes, a Live activity can be initiated locally within the application code (optional), in addition to being started remotely through Journey Optimizer.
recommendation-more-help
journey-optimizer-help