Set up Assurance

Learn how to set up Adobe Experience Platform Assurance in a mobile app.

Assurance, formally known as Project Griffon, is designed to help you inspect, proof, simulate, and validate how you collect data or serve experiences in your mobile app.

Assurance helps you inspect raw SDK events generated by the Adobe Experience Platform Mobile SDK. All events collected by the SDK are available for inspection. SDK events are loaded in a list view, sorted by time. Each event has a detailed view that provides further detail. Additional views to browse SDK configuration, data elements, Shared States, and SDK extension versions are also provided. Learn more about the Assurance in the product documentation.

Prerequisites

  • Successfully set up the app with SDKs installed and configured.

Learning objectives

In this lesson, you will:

  • Confirm that your organization has access (and request it if you don’t).
  • Set up your base URL.
  • Add required iOS specific code.
  • Connect to a session.

Confirm access

Confirm that your organization has access to Assurance. You, as user, should be added to profile for Adobe Experience Platform. See User access in the Assurance guide for more information.

Implement

In addition to the general SDK installation, you completed in the earlier lesson, iOS also requires the following addition to start the Assurance session for your app.

  1. Navigate to Luma > Luma > SceneDelegate in your Xcode’s Project navigator.

  2. Add the following code to func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>:

    code language-swift
    // Called when the app in background is opened with a deep link.
    if let deepLinkURL = URLContexts.first?.url {
        // Start the Assurance session
        Assurance.startSession(url: deepLinkURL)
    }
    

    This code starts an assurance session when the app is in the background and opened using a deep link.

More information can be found here.

Define bundle identifier

You need to provide a unique bundle identifier for your app.

  1. Open the project in Xcode.

  2. Select Luma in the Project navigator.

  3. Select the Luma target.

  4. Select the Signing & Capabilities tab.

  5. Define a Bundle Identifier.

    note important
    IMPORTANT
    Ensure you use a unique bundle identifier and replace the com.adobe.luma.tutorial.swiftui bundle identifier, as each bundle identifier needs to be unique. Typically, you use a reverse-DNS format for bundle ID strings, like com.organization.brand.uniqueidentifier. The Finished version of this tutorial, for example, uses com.adobe.luma.tutorial.swiftui.
    img-md
    modal-image
    Xcode signing capabilities

Set up a base URL

  1. Go to your project in Xcode.

  2. Select Luma in the Project navigator.

  3. Select the Luma target.

  4. Select the Info tab.

  5. To add a base URL, scroll down to URL Types and select the + button.

  6. Set Identifier to the Bundle Identifier of your choice and set a URL Schemes of your choice .

    assurance url

    note important
    IMPORTANT
    Ensure you use a unique bundle identifier and replace the com.adobe.luma.tutorial.swiftui bundle identifier, as each bundle identifier must be unique. Typically, you use a reverse-DNS format for bundle ID strings, like com.organization.brand.uniqueidentifier. You can use the same bundle identifier that you have used at Define bundle identifier.
    Similarly, use a unique URL scheme, and replace the already provided lumatutorialswiftui with your unique URL scheme.

To learn more about URL Schemes in iOS, review Apple’s documentation.

Assurance works by opening a URL, either via browser or QR code. That URL begins with the base URL which opens the app and contains additional parameters. Those unique parameters are used to connect the session.

Connecting to a session

In Xcode:

  1. Build or rebuild and run the app in the simulator or on a physical device from Xcode, using Play .

    note tip
    TIP
    Optionally, you might want to ‘clean’ your build, especially when you see unexpected results. To do this, select Clean Build Folder… from the Xcode Product menu.
  2. In the Allow “Luma App” to use your location dialog, select Allow While Using App.

    img-md
    w-300
  3. In the “Luma App” Would Like to Send You Notifications dialog, select Allow.

    img-md
    w-300
  4. Select Continue… to allow the app to track your activity.

    img-md
    w-300
  5. In the Allow “Luma App” to track your activity across other companies’ apps and websites dialog, select Allow.

    img-md
    w-300

In your browser:

  1. Go to the Data Collection UI.

  2. Select Assurance from the left rail.

  3. Select Create Session.

  4. Select Start.

  5. Provide a Session Name such as Luma Mobile App Session and the Base URL, which is the URL Schemes you entered in Xcode, followed by :// For example: lumatutorialswiftui://

  6. Select Next.
    assurance create session

  7. In the Create New Session modal dialog:

    If you’re using a physical device:

    • Select Scan QR Code. To open the app, use the camera on your physical device to scan the QR code and tap the link.

      assurance qa code

    If you are using a simulator:

    1. Select Copy Link.
    2. Copy the deep link using Copy and use the deep link to open the app with Safari in the simulator.
      Assurance copy link
  8. When the app loads, you are presented with a modal dialog asking you to enter the PIN shown in step 7.

    img-md
    w-300

    Enter the PIN and select Connect.

  9. If the connection was successful, you see:

    • An Assurance icon floating on top of your app.

      img-md
      w-300
    • Experience Cloud updates coming through in the Assurance UI, showing:

      1. Experience Events coming from the app.

      2. Details of a selected event.

      3. The device and timeline.

        assurance events

If you run into any challenges, review the technical and general documentation.

Verify extensions

To verify whether your app is using the most up-to-date extensions:

  1. Select Configure.

  2. Select Add for 123 Extension Versions.

  3. Select Save.

    Configure extension versions

  4. Select 123 Extension Versions to see an overview of the latest extensions available and the extensions used in your version of the app.

    Extension versions

  5. To update your extension versions (for example, Messaging and Optimize) select the package (extension) from Package Dependencies (for example, AEPMessaging) and from the context menu select Update Package. Xcode will update the package dependencies.

NOTE
Once you have updated your extensions (packages) in Xcode, close and delete your current session and repeat all steps from Connecting to a session and Verify extensions to ensure Assurance properly reports the correct extensions in a new Assurance session.
SUCCESS
You have now set up your app to use Assurance for the remainder of the tutorial.
Thank you for investing your time in learning about Adobe Experience Platform Mobile SDK. If you have questions, want to share general feedback, or have suggestions on future content, share them on this Experience League Community discussion post

Next: Implement Consent

recommendation-more-help
9fed61f5-c338-47ad-8005-0b89a5f4af8b