Identity
The Identity for Experience Cloud ID Service extension enables your app with the Experience Cloud ID (ECID). This service helps with the synchronization of Adobe and other customer identifiers.
Include the Identity extension in your application when using any of the following Adobe Solution extensions:
If your application uses the Edge Network extension, then it must include the Identity for Edge Network extension. The Identity for Edge Network extension does not replace the Identity for Experience Cloud ID Service extension and both may be required in an application. See the FAQ for more information.
When using third party extensions, check with the extension developer to understand if the Identity extension is a required dependency.
On web or other platforms, there might situations where this extension might not be required, and the implementation of this SDK extension on mobile apps is required.
To get started with Identity, complete the following steps:
- Add the Identity extension to your app.
- Implement the SDK APIs to complete the following tasks:
- Update customer IDs.
- Append Adobe visitor data to a URL string.
- Return customer IDs.
- Retrieve Experience Cloud IDs.
- Set advertising IDs.
- Set the device notification for push notifications.
Add the Identity extension to your app
- Add the
Identity
library 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:identity")
Groovy
Copied to your clipboardimplementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')implementation 'com.adobe.marketing.mobile:core'implementation 'com.adobe.marketing.mobile:identity'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
- Import the Identity and MobileCore extensions in your application's main activity.
Java
Import the library:
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Identity;
- Add the Mobile Core and Identity extensions to your project using Cocoapods. Add following pods in your
Podfile
:
Copied to your clipboarduse_frameworks!target 'YourTargetApp' dopod 'AEPCore', '~> 5.0'pod 'AEPIdentity', '~> 5.0'end
- Import the Identity library.
Swift
Copied to your clipboardimport AEPCoreimport AEPIdentity
Objective-C
Copied to your clipboard@import AEPCore;@import AEPIdentity;
- Add the
Identity
library 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:identity")
Groovy
Copied to your clipboardimplementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')implementation 'com.adobe.marketing.mobile:core'implementation 'com.adobe.marketing.mobile:identity'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
- Import the Identity and MobileCore extensions in your application's main activity.
Java
Import the library:
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Identity;
- Add the Mobile Core and Identity extensions to your project using Cocoapods. Add following pods in your
Podfile
:
Copied to your clipboarduse_frameworks!target 'YourTargetApp' dopod 'AEPCore', '~> 5.0'pod 'AEPIdentity', '~> 5.0'end
- Import the Identity library.
Swift
Copied to your clipboardimport AEPCoreimport AEPIdentity
Objective-C
Copied to your clipboard@import AEPCore;@import AEPIdentity;
Register the Identity extension
The MobileCore.registerExtensions()
API can be used to register the Identity extension with the Mobile Core extension. This API allows the extension to send and receive events to and from the Mobile SDK.
To register the Identity extension, use the following code sample:
After calling the setApplication()
method in the onCreate()
method, register the Identity extension.
Java
Copied to your clipboardpublic class MobileApp extends Application {@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);List<Class<? extends Extension>> extensions = Arrays.asList(Identity.EXTENSION, ...);MobileCore.registerExtensions(extensions, o -> {// Any other post registration processing});}}
Register the Identity extension in your app's didFinishLaunchingWithOptions
function:
Swift
When including both Identity and Identity for Edge Network extensions, register the extensions using their full Swift module names, such as AEPIdentity.Identity.self
.
Copied to your clipboardfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {MobileCore.registerExtensions([Identity.self, ...], {...})}
Objective-C
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[AEPMobileCore registerExtensions:@[AEPMobileIdentity.class, ...] completion:^{...}];return YES;}
After calling the setApplication()
method in the onCreate()
method, register the Identity extension.
Java
Copied to your clipboardpublic class MobileApp extends Application {@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);List<Class<? extends Extension>> extensions = Arrays.asList(Identity.EXTENSION, ...);MobileCore.registerExtensions(extensions, o -> {// Any other post registration processing});}}
Register the Identity extension in your app's didFinishLaunchingWithOptions
function:
Swift
When including both Identity and Identity for Edge Network extensions, register the extensions using their full Swift module names, such as AEPIdentity.Identity.self
.
Copied to your clipboardfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {MobileCore.registerExtensions([Identity.self, ...], {...})}
Objective-C
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[AEPMobileCore registerExtensions:@[AEPMobileIdentity.class, ...] completion:^{...}];return YES;}
Previously known as MCID/MID/MCMID, the Experience Cloud ID (ECID) is a 38 character ID that uniquely identifies each visitor in the Adobe Experience Platform.
After the configuration is complete, an ECID is generated and, where applicable, is included on all Analytics and Audience Manager hits. Other IDs, such as custom and automatically-generated IDs, continue to be sent with each hit.