51黑料不打烊

Set up Assurance

Learn how to set up 51黑料不打烊 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 51黑料不打烊 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鈥檛).
  • 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 a user, should be added to profile for 51黑料不打烊 Experience Platform. See User access in the Assurance guide for more information.

Implement

To implement Assurance in your app:

iOS

In addition to the general SDK installation, iOS also requires the following additional code to start the Assurance session for your app.

  1. Navigate to Luma > Luma > SceneDelegate in your Xcode鈥檚 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.

Android

In addition to the general SDK installation, Android also requires the following additional code to start the Assurance session for your app.

  1. In Android Studio, in the Android view, navigate to app > kotlin+java > com.adobe.luma.tutorial.android > LumaApplication.

  2. Add the following code to fun handleDeeplink(deeplink: String?):

    code language-kotlin
    // Called when the app in background is opened with a deep link.
    if (deeplink.isNullOrEmpty()) {
       Log.w("Luma", "Deeplink is null or empty")
       return
    }
    
    Log.i("Luma", "Handling deeplink: $deeplink")
    Assurance.startSession(deeplink)
    

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

See for more information.

Define a bundle identifier

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

iOS
  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.

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.

Xcode signing capabilities {modal="regular"}

Android
  1. Open the project in Android Studio.
  2. Select build.gradle.kts (Module :app) in the navigator.
  3. Ensure you use a unique bundle identifier and replace the com.adobe.luma.tutorial.android value for namespace in android
  4. Ensure you use the same unique bundle identifier and replace the com.adobe.luma.tutorial.android for applicationId in defaultConfig in android

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.android.

Android signing capabilities {modal="regular"}

Set up a base URL

You need to set up a base URL to ensure deep linking works.

iOS
  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 {modal="regular"}

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 .

Assurance works by opening a URL, either via a 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. In the example app, the deep link is lumatutorialswiftui://.

Android
  1. Go to the Android view of your project in Android Studio.

  2. Select app > manifests > AndroidManifest.xml in the navigator.

  3. Ensure the manifest > application > activity XML element looks like:

    code language-xml
    <activity
       android:name=".MainActivity"
       android:exported="true"
       android:theme="@style/Theme.LumaAndroid">
       <intent-filter>
             <action android:name="android.intent.action.MAIN" />
             <category android:name="android.intent.category.LAUNCHER" />
       </intent-filter>
       <intent-filter
             android:label="@string/app_name">
             <action android:name="android.intent.action.VIEW" />
             <category android:name="android.intent.category.DEFAULT" />
             <category android:name="android.intent.category.BROWSABLE" />
             <data android:scheme="lumatutorialandroid"
                android:host="default" />
       </intent-filter>
    </activity>
    

Ensure you specify an android:scheme (for example. lumatutorialandroid) and android:host (for example default) to define the base URL.

To learn more about deep links in Android, see .

Assurance works by opening a URL, either via a 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. In the example app, the deep link is lumatutorialandroid://default.

Connecting to a session

You can now use Assurance to connect to a session.

iOS

In Xcode:

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

    Optionally, you might want to clean your build, especially when you see unexpected results. Select Clean Build Folder鈥 from the Xcode Product menu.

  2. In the Allow 鈥淟uma App鈥 to use your location dialog, select Allow While Using App.

    {width="300"}

  3. In the 鈥淟uma App鈥 Would Like to Send You Notifications dialog, select Allow.

    {width="300"}

  4. Select 颁辞苍迟颈苍耻别鈥 to allow the app to track your activity.

    {width="300"}

  5. In the Allow 鈥淟uma App鈥 to track your activity across other companies鈥 apps and websites dialog, select Allow.

    {width="300"}

  6. Select Continue.

In your browser:

  1. Go to the Data Collection UI.

  2. Select Assurance from the left rail.

  3. Select Create New Session, and the option Deep link connect.

  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 {modal="regular"}

  7. In the Create New Session modal dialog:

    If you鈥檙e 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 {modal="regular"}

    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 {modal="regular"}

  8. When the app loads, you are presented with a modal dialog asking you to enter the PIN shown in step 7.

    {width="300"}

    Enter the PIN and select Connect.

  9. If the connection was successful, you see:

    • An Assurance icon floating on top of your app.

      {width="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 {modal="regular"}

  10. Select Continue to go to the Home screen.

Android

In Android Studio:

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

    Optionally, you might want to clean your build, especially when you see unexpected results. Select Clean Project from the Android Studio Build menu.

  2. In the Allow Luma Android to send you notifications dialog, select Allow.

    {width="300"}

  3. Select Show permission dialog.

    {width="300"}

  4. In the Allow Luma Android to access this device鈥檚 location?

    {width="300"}

    • Select Precise.
    • Select While using the app.
  5. Back in the introduction app screen, select Open device settings.

  6. In the Location permission screen, select Allow all the time. Then select to return to the introduction app screen.

    {width="300"}

  7. Select Continue to go to the Home screen.

In your browser:

  1. Go to the Data Collection UI.

  2. Select Assurance from the left rail.

  3. Select Create New Session, and the option Deep link connect.

  4. Select Start.

  5. Provide a Session Name such as Luma Mobile App Session and the Base URL, which is the android:scheme and android:host you defined in AndroidManifest.xml in Android Studio, separated by :// For example: lumatutorialandroid://default

  6. Select Next.
    assurance create session {modal="regular"}

  7. In the Create New Session modal dialog:

    If you鈥檙e 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 {modal="regular"}

    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 Chrome in the simulator.

    Assurance copy link {modal="regular"}

    When prompted in Chrome to Continue to Luma Android, select Continue.

  8. When the app loads, you are presented with a modal dialog asking you to enter the PIN shown in step 7.

    {width="300"}

    Enter the PIN and select Connect.

  9. If the connection was successful, you see:

    • An Assurance icon floating on top of your app.

      {width="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 {modal="regular"}

If you run into any challenges, review the 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 {modal="regular"}

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

iOS

Extension versions {modal="regular"}

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 updates the package dependencies.

Android

Extension versions {modal="regular"}

If you see outdated extensions, refer to the on how to update your dependency modules for your project.

NOTE
Once you have updated your extensions (packages) in your development environment, close and delete your current session and repeat all steps from Connecting to a session and Verify extensions to ensure that 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 51黑料不打烊 Experience Platform Mobile SDK. If you have questions, want to share general feedback, or have suggestions on future content, share them on this

Next: Implement Consent

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