Get the Adobe Experience Platform Mobile SDK
The Adobe Experience Platform SDK is available for Apple iOS (includes iOS, iPadOS, and tvOS) via Cocoapods and Swift Package Manager, and for Google Android via Gradle.
Follow the directions below to include the SDK into your mobile application.
For iOS and Android projects, the recommended approach for integrating the SDK is to use supported dependency and package managers as listed for each platform such as Maven (Android), and Cocoapods or Swift Package Manager (iOS).
The SDK can also be downloaded for iOS and Android projects following the listed methods:
1. For iOS, XCFramework for different SDK extensions are also available for download from corresponding GitHub repositories. For example, Mobile Core and related extensions XCFramework zip file can be found on the GitHub by selecting Releases.
2. For Android, the aar is already available for download from Maven central. For example, Mobile Core extension aar file can be found under the corresponding package by selecting Browse.
- Select the tag property you created earlier in the Data Collection UI.
- In your tag property's details page, Select the Environments tab on the left nav. The Environments tab lists the different environments where you can publish, e.g. Development, Staging, and Production.
- Select the install package icon (under INSTALL column) for the appropriate environment row. You should see a dialog box titled Mobile Install Instructions.
- On the open dialog box, select the appropriate platform tab Android or iOS.
- Copy the necessary dependencies and initialization code from the dialog box to your mobile application project.
Latest version of the Adobe Experience Platform SDKs for Android supports Android 5.0 (API 21) or later.
Adobe Experience Platform SDKs for iOS support iOS 12 or later; requires Swift 5.1 or newer; and Xcode 15.0 or newer.
In order to support the new Apple M1 architecture while maintaining support for existing Intel architecture, the Adobe Experience Platform SDKs are now distributed using XCFrameworks. Please see the current SDK versions for more information on the latest extension versions.
Latest version of the Adobe Experience Platform SDKs for Android supports Android 5.0 (API 21) or later.
Adobe Experience Platform SDKs for iOS support iOS 12 or later; requires Swift 5.1 or newer; and Xcode 15.0 or newer.
In order to support the new Apple M1 architecture while maintaining support for existing Intel architecture, the Adobe Experience Platform SDKs are now distributed using XCFrameworks. Please see the current SDK versions for more information on the latest extension versions.
Installation instructions
If you cannot access the Mobile Install Instructions dialog box in the Data Collection UI, complete the following sections to get the Adobe Experience Platform SDK. If you already completed the steps in the Mobile Install Instructions dialog box, no need to complete these steps.
1. Add dependencies to your project
Each extension needs to be added as a dependency to the mobile application project. The following examples will add the Mobile Core and Profile extensions.
Add the dependencies to build.gradle
for each extension.
Copied to your clipboardimplementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')implementation 'com.adobe.marketing.mobile:userprofile'implementation 'com.adobe.marketing.mobile:core'implementation 'com.adobe.marketing.mobile:identity'implementation 'com.adobe.marketing.mobile:signal'implementation 'com.adobe.marketing.mobile:lifecycle'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
Create a Podfile
if you do not already have one:
Copied to your clipboardpod init
Add the dependencies to your Podfile
for each extension.
Copied to your clipboarduse_frameworks!pod 'AEPEdgeConsent', '~> 5.0'pod 'AEPAssurance', '~> 5.0'pod 'AEPEdgeIdentity', '~> 5.0'pod 'AEPEdge', '~> 5.0'pod 'AEPUserProfile', '~> 5.0'pod 'AEPCore', '~> 5.0'pod 'AEPIdentity', '~> 5.0'pod 'AEPSignal', '~> 5.0'pod 'AEPLifecycle', '~> 5.0'
If Cocoapods cannot not find the dependencies, you may need to run this command:
Copied to your clipboardpod repo update
Save the Podfile
and run install:
Copied to your clipboardpod install
Add the dependencies to build.gradle
for each extension.
Copied to your clipboardimplementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')implementation 'com.adobe.marketing.mobile:userprofile'implementation 'com.adobe.marketing.mobile:core'implementation 'com.adobe.marketing.mobile:identity'implementation 'com.adobe.marketing.mobile:signal'implementation 'com.adobe.marketing.mobile:lifecycle'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
Create a Podfile
if you do not already have one:
Copied to your clipboardpod init
Add the dependencies to your Podfile
for each extension.
Copied to your clipboarduse_frameworks!pod 'AEPEdgeConsent', '~> 5.0'pod 'AEPAssurance', '~> 5.0'pod 'AEPEdgeIdentity', '~> 5.0'pod 'AEPEdge', '~> 5.0'pod 'AEPUserProfile', '~> 5.0'pod 'AEPCore', '~> 5.0'pod 'AEPIdentity', '~> 5.0'pod 'AEPSignal', '~> 5.0'pod 'AEPLifecycle', '~> 5.0'
If Cocoapods cannot not find the dependencies, you may need to run this command:
Copied to your clipboardpod repo update
Save the Podfile
and run install:
Copied to your clipboardpod install
2. Add initialization code
Next you'll need to import SDK libraries into your project and register them for initialization. Extensions are registered with Mobile Core so that they can dispatch and listen for events.
Extension registration is mandatory. Attempting to make extension-specific API calls without registering the extension will lead to undefined behavior.
Currently, the Adobe Experience Platform SDKs do not support running under Direct Boot mode on Android devices. For Android applications configured to be run during Direct Boot mode, verify if the user has unlocked the devices by calling UserManager.isUserUnlocked() before initializing the SDK.
The following code snippets demonstrate how you can import and register the Mobile Core and Profile extensions. You can also see, for reference, how Identity, Lifecycle, Signal, Profile, and other extensions are imported and registered.
After you register the extensions, call the start
API in Mobile Core to initialize the SDK as shown below. This step is required to boot up the SDK for event processing. The following code snippet is provided as a sample reference.
Java
Copied to your clipboardimport com.adobe.marketing.mobile.AdobeCallback;import com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.Edge;import com.adobe.marketing.mobile.Extension;import com.adobe.marketing.mobile.Identity;import com.adobe.marketing.mobile.Lifecycle;import com.adobe.marketing.mobile.LoggingMode;import com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Signal;import com.adobe.marketing.mobile.UserProfile;import com.adobe.marketing.mobile.edge.consent.Consent;import com.adobe.marketing.mobile.edge.identity.Identity;import java.util.Arrays;import java.util.List;...import android.app.Application;...public class MainApp extends Application {...@Overridepublic void on Create(){super.onCreate();MobileCore.setApplication(this);MobileCore.setLogLevel(LoggingMode.DEBUG);...List<Class<? extends Extension>> extensions = Arrays.asList(Consent.EXTENSION,Assurance.EXTENSION,com.adobe.marketing.mobile.edge.identity.Identity.EXTENSION,com.adobe.marketing.mobile.Identity.EXTENSION,Edge.EXTENSION,UserProfile.EXTENSION,Lifecycle.EXTENSION,Signal.EXTENSION);MobileCore.registerExtensions(extensions, new AdobeCallback () {@Overridepublic void call(Object o) {MobileCore.configureWithAppID("<your_environment_file_id>");}});}}
Java (Direct Boot enabled)
Copied to your clipboardimport com.adobe.marketing.mobile.AdobeCallback;import com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.Edge;import com.adobe.marketing.mobile.Extension;import com.adobe.marketing.mobile.Identity;import com.adobe.marketing.mobile.Lifecycle;import com.adobe.marketing.mobile.LoggingMode;import com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Signal;import com.adobe.marketing.mobile.UserProfile;import com.adobe.marketing.mobile.edge.consent.Consent;import com.adobe.marketing.mobile.edge.identity.Identity;import java.util.Arrays;import java.util.List;...import android.app.Application;import androidx.core.os.UserManagerCompat; // Access features in android UserManager in backwards compatible manner...public class MainApp extends Application {...@Overridepublic void on Create(){super.onCreate();if(UserManagerCompat.isUserUnlocked(this.getApplicationContext())) {MobileCore.setApplication(this);MobileCore.setLogLevel(LoggingMode.DEBUG);...List<Class<? extends Extension>> extensions = Arrays.asList(Consent.EXTENSION,Assurance.EXTENSION,com.adobe.marketing.mobile.edge.identity.Identity.EXTENSION,com.adobe.marketing.mobile.Identity.EXTENSION,Edge.EXTENSION,UserProfile.EXTENSION,Lifecycle.EXTENSION,Signal.EXTENSION);MobileCore.registerExtensions(extensions, new AdobeCallback () {@Overridepublic void call(Object o) {MobileCore.configureWithAppID("<your_environment_file_id>");}});}}}
For iOS Swift libraries, registration is changed to a single API call (as shown in the snippets below). Calling theMobileCore.start
API is no longer required.
Swift
Copied to your clipboard// AppDelegate.swiftimport AEPCoreimport AEPEdgeConsentimport AEPAssuranceimport AEPEdgeIdentityimport AEPEdgeimport AEPUserProfileimport AEPIdentityimport AEPLifecycleimport AEPSignalimport AEPServicesfinal class AppDelegate: NSObject, UIApplicationDelegate {func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {MobileCore.setLogLevel(.debug)let appState = application.applicationState...let extensions = [Consent.self,Assurance.self,AEPEdgeIdentity.Identity.self,AEPIdentity.Identity.self,Edge.self,UserProfile.self,Lifecycle.self,Signal.self]MobileCore.registerExtensions(extensions, {MobileCore.configureWith(appId: "<your_environment_file_id>")if appState != .background {MobileCore.lifecycleStart(additionalContextData: ["contextDataKey": "contextDataVal"])}})...}}
Objective-C
Copied to your clipboard// AppDelegate.m#import "AppDelegate.h"@import AEPCore;@import AEPEdgeConsent;@import AEPAssurance;@import AEPEdgeIdentity;@import AEPEdge;@import AEPUserProfile;@import AEPIdentity;@import AEPLifecycle;@import AEPSignal;@import AEPServices;...@implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[AEPMobileCore setLogLevel: AEPLogLevelDebug];...NSArray *extensionsToRegister = @[AEPMobileEdgeConsent.class,AEPMobileAssurance.class,AEPMobileEdgeIdentity.class,AEPMobileEdge.class,AEPMobileUserProfile.class,AEPMobileIdentity.class,AEPMobileLifecycle.class,AEPMobileSignal.class];[AEPMobileCore registerExtensions:extensionsToRegister completion:^{[AEPMobileCore lifecycleStart:@{@"contextDataKey": @"contextDataVal"}];}];[AEPMobileCore configureWithAppId: @"<your_environment_file_id>"];...return YES;}@end
After you register the extensions, call the start
API in Mobile Core to initialize the SDK as shown below. This step is required to boot up the SDK for event processing. The following code snippet is provided as a sample reference.
Java
Copied to your clipboardimport com.adobe.marketing.mobile.AdobeCallback;import com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.Edge;import com.adobe.marketing.mobile.Extension;import com.adobe.marketing.mobile.Identity;import com.adobe.marketing.mobile.Lifecycle;import com.adobe.marketing.mobile.LoggingMode;import com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Signal;import com.adobe.marketing.mobile.UserProfile;import com.adobe.marketing.mobile.edge.consent.Consent;import com.adobe.marketing.mobile.edge.identity.Identity;import java.util.Arrays;import java.util.List;...import android.app.Application;...public class MainApp extends Application {...@Overridepublic void on Create(){super.onCreate();MobileCore.setApplication(this);MobileCore.setLogLevel(LoggingMode.DEBUG);...List<Class<? extends Extension>> extensions = Arrays.asList(Consent.EXTENSION,Assurance.EXTENSION,com.adobe.marketing.mobile.edge.identity.Identity.EXTENSION,com.adobe.marketing.mobile.Identity.EXTENSION,Edge.EXTENSION,UserProfile.EXTENSION,Lifecycle.EXTENSION,Signal.EXTENSION);MobileCore.registerExtensions(extensions, new AdobeCallback () {@Overridepublic void call(Object o) {MobileCore.configureWithAppID("<your_environment_file_id>");}});}}
Java (Direct Boot enabled)
Copied to your clipboardimport com.adobe.marketing.mobile.AdobeCallback;import com.adobe.marketing.mobile.Assurance;import com.adobe.marketing.mobile.Edge;import com.adobe.marketing.mobile.Extension;import com.adobe.marketing.mobile.Identity;import com.adobe.marketing.mobile.Lifecycle;import com.adobe.marketing.mobile.LoggingMode;import com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Signal;import com.adobe.marketing.mobile.UserProfile;import com.adobe.marketing.mobile.edge.consent.Consent;import com.adobe.marketing.mobile.edge.identity.Identity;import java.util.Arrays;import java.util.List;...import android.app.Application;import androidx.core.os.UserManagerCompat; // Access features in android UserManager in backwards compatible manner...public class MainApp extends Application {...@Overridepublic void on Create(){super.onCreate();if(UserManagerCompat.isUserUnlocked(this.getApplicationContext())) {MobileCore.setApplication(this);MobileCore.setLogLevel(LoggingMode.DEBUG);...List<Class<? extends Extension>> extensions = Arrays.asList(Consent.EXTENSION,Assurance.EXTENSION,com.adobe.marketing.mobile.edge.identity.Identity.EXTENSION,com.adobe.marketing.mobile.Identity.EXTENSION,Edge.EXTENSION,UserProfile.EXTENSION,Lifecycle.EXTENSION,Signal.EXTENSION);MobileCore.registerExtensions(extensions, new AdobeCallback () {@Overridepublic void call(Object o) {MobileCore.configureWithAppID("<your_environment_file_id>");}});}}}
For iOS Swift libraries, registration is changed to a single API call (as shown in the snippets below). Calling theMobileCore.start
API is no longer required.
Swift
Copied to your clipboard// AppDelegate.swiftimport AEPCoreimport AEPEdgeConsentimport AEPAssuranceimport AEPEdgeIdentityimport AEPEdgeimport AEPUserProfileimport AEPIdentityimport AEPLifecycleimport AEPSignalimport AEPServicesfinal class AppDelegate: NSObject, UIApplicationDelegate {func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {MobileCore.setLogLevel(.debug)let appState = application.applicationState...let extensions = [Consent.self,Assurance.self,AEPEdgeIdentity.Identity.self,AEPIdentity.Identity.self,Edge.self,UserProfile.self,Lifecycle.self,Signal.self]MobileCore.registerExtensions(extensions, {MobileCore.configureWith(appId: "<your_environment_file_id>")if appState != .background {MobileCore.lifecycleStart(additionalContextData: ["contextDataKey": "contextDataVal"])}})...}}
Objective-C
Copied to your clipboard// AppDelegate.m#import "AppDelegate.h"@import AEPCore;@import AEPEdgeConsent;@import AEPAssurance;@import AEPEdgeIdentity;@import AEPEdge;@import AEPUserProfile;@import AEPIdentity;@import AEPLifecycle;@import AEPSignal;@import AEPServices;...@implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[AEPMobileCore setLogLevel: AEPLogLevelDebug];...NSArray *extensionsToRegister = @[AEPMobileEdgeConsent.class,AEPMobileAssurance.class,AEPMobileEdgeIdentity.class,AEPMobileEdge.class,AEPMobileUserProfile.class,AEPMobileIdentity.class,AEPMobileLifecycle.class,AEPMobileSignal.class];[AEPMobileCore registerExtensions:extensionsToRegister completion:^{[AEPMobileCore lifecycleStart:@{@"contextDataKey": @"contextDataVal"}];}];[AEPMobileCore configureWithAppId: @"<your_environment_file_id>"];...return YES;}@end
3. Ensure app permissions (Android only)
For Android, the SDK requires standard network connection permissions in your manifest to send data, collect cellular provider, and record offline tracking calls.
To enable these permissions, add the following lines to your AndroidManifest.xml
file, located in your app's application project directory:
Copied to your clipboard<uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Additional information
- How to use Gradle for Android
- How to use CocoaPods for iOS
- How to use Swift Package Manager for iOS
- Current SDK Versions
Get help
- Visit the SDK community forum to ask questions
- Contact Adobe Experience Cloud customer care for immediate assistance