Adobe Experience Platform Assurance extension
This extension enables capabilities for Adobe Experience Platform Assurance.
To get started with Assurance in your app, you'll need to:
- Install the AEP Assurance extension in the Data Collection UI
- Add AEP Assurance SDK extension library to your app
- Import AEP Assurance into your app
- Register and implement extension APIs
Install the AEP Assurance extension in the Data Collection UI
Go to the Experience Platform Data Collection UI and select your mobile property:
- In the Data Collection UI, select the Extensions tab.
- On the Catalog tab, locate the AEP Assurance extension, and select Install.
- Follow the publishing process to update the Mobile SDK configuration.
Add the AEP Assurance extension to your app
Import the library to your app code
- Add the following libraries to your project using the app's Gradle file.
Kotlin
Copied to your clipboardimplementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+"))implementation("com.adobe.marketing.mobile:core")implementation("com.adobe.marketing.mobile:assurance")
Groovy
Copied to your clipboardimplementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')implementation 'com.adobe.marketing.mobile:core'implementation 'com.adobe.marketing.mobile:assurance'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
- Import the Assurance library along with the other Mobile SDK libraries:
Copied to your clipboardimport com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.MobileCore;
- Import the Assurance library along with the other Mobile SDK libraries:
Copied to your clipboardimport com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.MobileCore;
Add the library to your project via your Cocoapods Podfile
:
Copied to your clipboardpod 'AEPCore','~> 5.0'pod 'AEPAssurance','~> 5.0'
Import the Assurance extension along with the other Adobe Mobile SDK extensions:
Swift
Copied to your clipboardimport AEPCoreimport AEPAssurance
Objective-C
Copied to your clipboard@import AEPCore;@import AEPAssurance;
- Add the following libraries to your project using the app's Gradle file.
Kotlin
Copied to your clipboardimplementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+"))implementation("com.adobe.marketing.mobile:core")implementation("com.adobe.marketing.mobile:assurance")
Groovy
Copied to your clipboardimplementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')implementation 'com.adobe.marketing.mobile:core'implementation 'com.adobe.marketing.mobile:assurance'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
- Import the Assurance library along with the other Mobile SDK libraries:
Copied to your clipboardimport com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.MobileCore;
- Import the Assurance library along with the other Mobile SDK libraries:
Copied to your clipboardimport com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.MobileCore;
Add the library to your project via your Cocoapods Podfile
:
Copied to your clipboardpod 'AEPCore','~> 5.0'pod 'AEPAssurance','~> 5.0'
Import the Assurance extension along with the other Adobe Mobile SDK extensions:
Swift
Copied to your clipboardimport AEPCoreimport AEPAssurance
Objective-C
Copied to your clipboard@import AEPCore;@import AEPAssurance;
Register AEPAssurance with Mobile Core
The MobileCore.registerExtensions()
API can be used to register the Assurance extension with the Mobile Core extension. This API allows the extension to send and receive events to and from the Mobile SDK.
- Import the Assurance library along with the other Mobile SDK libraries:
Copied to your clipboardimport com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.MobileCore;
Java
Copied to your clipboardpublic class MainApp extends Application {private final String ENVIRONMENT_FILE_ID = "YOUR_APP_ENVIRONMENT_ID";@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);MobileCore.setLogLevel(LoggingMode.VERBOSE);MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID);List<Class<? extends Extension>> extensions = Arrays.asList(Assurance.EXTENSION,...);MobileCore.registerExtensions(extensions, o -> {Log.d(LOG_TAG, "AEP Mobile SDK is initialized");});}}
Kotlin
Copied to your clipboardclass MyApp : Application() {override fun onCreate() {super.onCreate()MobileCore.setApplication(this)MobileCore.setLogLevel(LoggingMode.VERBOSE)MobileCore.configureWithAppID("YOUR_APP_ENVIRONMENT_ID")val extensions = listOf(Assurance.EXTENSION, ...)MobileCore.registerExtensions(extensions) {Log.d(LOG_TAG, "AEP Mobile SDK is initialized")}}}
- Import the Assurance library along with the other Mobile SDK libraries:
Copied to your clipboardimport com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.MobileCore;
To start using the extension library, you must first register the extension with the Mobile Core extension.
Swift
Copied to your clipboardfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {let extensions = [Assurance.self, ...]MobileCore.registerExtensions(extensions, {// set app id from the Data Collection UIMobileCore.configureWith(appId: "yourAppId")})return true}
Objective-C
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {NSArray *extensionsToRegister = @[AEPMobileAssurance.class, ...];[AEPMobileCore registerExtensions:extensionsToRegister completion:^{// set app id from the Data Collection UI[AEPMobileCore configureWithAppId: @"yourAppId"];}];return YES;}
- Import the Assurance library along with the other Mobile SDK libraries:
Copied to your clipboardimport com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.MobileCore;
Java
Copied to your clipboardpublic class MainApp extends Application {private final String ENVIRONMENT_FILE_ID = "YOUR_APP_ENVIRONMENT_ID";@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);MobileCore.setLogLevel(LoggingMode.VERBOSE);MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID);List<Class<? extends Extension>> extensions = Arrays.asList(Assurance.EXTENSION,...);MobileCore.registerExtensions(extensions, o -> {Log.d(LOG_TAG, "AEP Mobile SDK is initialized");});}}
Kotlin
Copied to your clipboardclass MyApp : Application() {override fun onCreate() {super.onCreate()MobileCore.setApplication(this)MobileCore.setLogLevel(LoggingMode.VERBOSE)MobileCore.configureWithAppID("YOUR_APP_ENVIRONMENT_ID")val extensions = listOf(Assurance.EXTENSION, ...)MobileCore.registerExtensions(extensions) {Log.d(LOG_TAG, "AEP Mobile SDK is initialized")}}}
- Import the Assurance library along with the other Mobile SDK libraries:
Copied to your clipboardimport com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.MobileCore;
To start using the extension library, you must first register the extension with the Mobile Core extension.
Swift
Copied to your clipboardfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {let extensions = [Assurance.self, ...]MobileCore.registerExtensions(extensions, {// set app id from the Data Collection UIMobileCore.configureWith(appId: "yourAppId")})return true}
Objective-C
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {NSArray *extensionsToRegister = @[AEPMobileAssurance.class, ...];[AEPMobileCore registerExtensions:extensionsToRegister completion:^{// set app id from the Data Collection UI[AEPMobileCore configureWithAppId: @"yourAppId"];}];return YES;}
Connect to an Assurance session
- Import the Assurance library along with the other Mobile SDK libraries:
Copied to your clipboardimport com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.MobileCore;
Deep linking is the best way to connnect to an Assurance session when using the Android SDK. Assurance SDK on Android is already setup to handle incoming intents to your app. You can add an intent filter for incoming links in your app to complete the deep link configuration. The combination of android:host
and android:scheme
(in the form of <host>://<scheme>
) for this intent filter will serve as the Base URL while creating a session in the Adobe Experience Platform Assurance UI
- Import the Assurance library along with the other Mobile SDK libraries:
Copied to your clipboardimport com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.MobileCore;
The startSession API needs to be called to begin an Adobe Experience Platform Assurance session. You should call this API when the app launches with a URL (see code snippet below for sample usage). When called, SDK displays a PIN authentication overlay to begin a session.
Swift
Example
Copied to your clipboardfunc application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {Assurance.startSession(url: url)return true}
In iOS 13 and later, for a scene-based application, use the UISceneDelegate
's scene(_:openURLContexts:)
method as follows:
Copied to your clipboardfunc scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {// Called when the app in background is opened with a deep link.if let deepLinkURL = URLContexts.first?.url {Assurance.startSession(url: deepLinkURL)}}func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {// Called when the app launches with the deep linkif let deepLinkURL = connectionOptions.urlContexts.first?.url {Assurance.startSession(url: deepLinkURL)}}
Objective-C
Syntax
Copied to your clipboardstatic func startSession(url: URL?)
Example
Copied to your clipboard- (BOOL)application:(UIApplication *)app openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {[AEPMobileAssurance startSessionWithUrl:url];return true;}
In iOS 13 and later, for a scene-based application, use the UISceneDelegate
's scene(_:openURLContexts:)
method as follows:
Copied to your clipboard- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {NSURL *deepLinkURL = connectionOptions.URLContexts.allObjects.firstObject.URL;[AEPMobileAssurance startSessionWithUrl:deepLinkURL];}- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts {[AEPMobileAssurance startSessionWithUrl:URLContexts.allObjects.firstObject.URL];}
- Import the Assurance library along with the other Mobile SDK libraries:
Copied to your clipboardimport com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.MobileCore;
Deep linking is the best way to connnect to an Assurance session when using the Android SDK. Assurance SDK on Android is already setup to handle incoming intents to your app. You can add an intent filter for incoming links in your app to complete the deep link configuration. The combination of android:host
and android:scheme
(in the form of <host>://<scheme>
) for this intent filter will serve as the Base URL while creating a session in the Adobe Experience Platform Assurance UI
- Import the Assurance library along with the other Mobile SDK libraries:
Copied to your clipboardimport com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.MobileCore;
The startSession API needs to be called to begin an Adobe Experience Platform Assurance session. You should call this API when the app launches with a URL (see code snippet below for sample usage). When called, SDK displays a PIN authentication overlay to begin a session.
Swift
Example
Copied to your clipboardfunc application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {Assurance.startSession(url: url)return true}
In iOS 13 and later, for a scene-based application, use the UISceneDelegate
's scene(_:openURLContexts:)
method as follows:
Copied to your clipboardfunc scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {// Called when the app in background is opened with a deep link.if let deepLinkURL = URLContexts.first?.url {Assurance.startSession(url: deepLinkURL)}}func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {// Called when the app launches with the deep linkif let deepLinkURL = connectionOptions.urlContexts.first?.url {Assurance.startSession(url: deepLinkURL)}}
Objective-C
Syntax
Copied to your clipboardstatic func startSession(url: URL?)
Example
Copied to your clipboard- (BOOL)application:(UIApplication *)app openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {[AEPMobileAssurance startSessionWithUrl:url];return true;}
In iOS 13 and later, for a scene-based application, use the UISceneDelegate
's scene(_:openURLContexts:)
method as follows:
Copied to your clipboard- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {NSURL *deepLinkURL = connectionOptions.URLContexts.allObjects.firstObject.URL;[AEPMobileAssurance startSessionWithUrl:deepLinkURL];}- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts {[AEPMobileAssurance startSessionWithUrl:URLContexts.allObjects.firstObject.URL];}