Java
Adobe Experience Platform SDKs for Android supports Android 4.0 (API 14) or later.
- Open the mobile property you created earlier in the Data Collection UI.
- On your mobile property's details page, select the Environments tab.
The Environments tab lists the different environments where you can publish.
- In the row for the Development environment, select the install package icon, as seen below:
You should see a dialog box similar to the following:
- On the Mobile Install Instructions dialog box, make sure you are on the Android tab.
- Follow the instructions for using Gradle with Android.
The necessary dependencies and initialization code can be copied from the dialog box to your mobile application project.
Adobe Experience Platform SDKs for iOS support iOS 10 or later; requires Swift 5.1 or newer; and Xcode 11.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 release notes and the document on current SDK versions for more information on the latest extension versions.
- Open a previously created and configured Mobile property in the Data Collection UI, and select the Environments tab, followed by the install package icon, as seen below.
- On the Mobile Install Instructions dialog box, select iOS.
- Follow the instructions for using CocoaPods with iOS.
- Under the initialization code, choose Objective-C or Swift.
The necessary dependencies and initialization code can be copied from the dialog box to your app project.
You should see a pop-up similar to the following image:
React Native
Adobe Experience Platform Mobile SDK plugin for React Native supports React Native version 0.60.0 or later. For the latest installation instructions, see the README file in the react-native-acpcore repository.
For React Native, you should install Node.js to download packages from npm. For additional instructions, see this tutorial on getting started with React Native applications.
v2.0.0 and above of the AEP Mobile SDK React Native plugins use autolinking, which links plugins' native dependencies automatically. For iOS development, after installing the plugins from npm, download the pod dependencies by running the following command:
cd ios && pod install && cd ..
To update native dependencies to latest available versions, run the following command:
cd ios && pod update && cd ..
Flutter
Adobe Experience Platform Mobile SDK plugin for Flutter supports Flutter versions 1.10.0 or later.
For the latest Flutter installation instructions, see the package install tab.
Cordova
Adobe Experience Platform Mobile SDK plugins for Cordova supports Cordova versions 9.0.0 or later. For the latest Cordova installation instructions, see the README file in the cordova-acpcore repository.
For Cordova, you should install Node.js to download packages from npm. For additional instructions, see this guide to get started with Cordova applications.
With Node.js installed, you can install the Cordova framework from terminal using the following statement:
Copied to your clipboardsudo npm install -g cordova
To start using the Adobe Experience Platform Mobile SDK plugin for Cordova, navigate to the directory of your Cordova app and install the plugins using the following statement:
Copied to your clipboardcordova plugin add https://github.com/adobe/cordova-acpcore.git
Unity
Adobe Experience Platform SDKs plugins for Unity supports Unity versions 2019.3.10f1 or later
For the latest Unity installation instructions, see the README file in the unity-acpcore repository.
To start using the Adobe Experience Platform Mobile SDK for Unity, open your application and import the requisite Unity packages.
For instance, to add the Mobile Core extension, you should:
- Download ACPCore-0.0.1-Unity.zip
- Unzip
ACPCore-0.0.1-Unity.zip - Import
ACPCore.unitypackagevia Assets-Import Package
Xamarin
Adobe Experience Platform Mobile SDK plugins for Xamarin require MonoAndroid 9.0+ and Xamarin.iOS 1.0+. For the latest Xamarin installation instructions, see the README file in the xamarin-acpcore repository.
The Adobe Experience Platform Mobile SDK plugins for Xamarin are packages distributed via nuget. NuGet packages can be added to projects within a Visual Studio solution. The NuGet packages can also be generated locally via the included Makefile located in each of the Xamarin repositories.
Java
Add the dependencies to build.gradle for each extension.
Copied to your clipboardimplementation 'com.adobe.marketing.mobile:userprofile:1.+'implementation 'com.adobe.marketing.mobile:sdk-core:1.+'
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 'ACPCore', '~> 2.0'pod 'ACPUserProfile', '~> 2.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
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.Identity;import com.adobe.marketing.mobile.InvalidInitException;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 android.app.Application;...public class MainApp extends Application {...@Overridepublic void on Create(){super.onCreate();MobileCore.setApplication(this);MobileCore.setLogLevel(LoggingMode.DEBUG);...try {UserProfile.registerExtension();Identity.registerExtension();Lifecycle.registerExtension();Signal.registerExtension();MobileCore.start(new AdobeCallback () {@Overridepublic void call(Object o) {MobileCore.configureWithAppID("<your_environment_id_from_Launch>");}});} catch (InvalidInitException e) {...}}}
The following snippet shows an example of how to add the initialization code. Note that this may need to be adjusted, depending on how your application is structured.
Swift
Copied to your clipboardimport ACPCoreimport ACPUserProfile...@UIApplicationMainclass AppDelegate: UIResponder, UIApplicationDelegate {var window: UIWindow?func application(_application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool{ACPCore.setLogLevel(.debug)ACPCore.configure(withAppId: "<your_environment_id_from_Launch>")...ACPUserProfile.registerExtension()ACPIdentity.registerExtension()ACPLifecycle.registerExtension()ACPSignal.registerExtension()ACPCore.start {ACPCore.lifecycleStart(nil)}...return true}}
Objective-C
Copied to your clipboard#import "AppDelegate.h"#import "ACPCore.h"#import "ACPUserProfile.h"#import "ACPIdentity.h"#import "ACPLifecycle.h"#import "ACPSignal.h"...@implementation AppDelegate-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[ACPCore setLogLevel:ACPMobileLogLevelDebug];[ACPCore configureWithAppId:@"<your_environment_id_from_Launch>"];...[ACPUserProfile registerExtension];[ACPIdentity registerExtension];[ACPLifecycle registerExtension];[ACPSignal registerExtension];const UIApplicationState appState = application.applicationState;[ACPCore start:^{// only start lifecycle if the application is not in the backgroundif (appState != UIApplicationStateBackground) {[ACPCore lifecycleStart:nil];}}];...return YES;}@end
For React Native apps, initialize the SDK using native code in your AppDelegate (iOS) and MainApplication (Android).
iOS
Copied to your clipboard#import "ACPCore.h"#import "ACPUserProfile.h"#import "ACPIdentity.h"#import "ACPLifecycle.h"#import "ACPSignal.h"...@implementation AppDelegate-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[ACPCore setLogLevel:ACPMobileLogLevelDebug];[ACPCore configureWithAppId:@"<your_environment_id_from_Launch>"];[ACPUserProfile registerExtension];[ACPIdentity registerExtension];[ACPLifecycle registerExtension];[ACPSignal registerExtension];const UIApplicationState appState = application.applicationState;[ACPCore start:^{// only start lifecycle if the application is not in the backgroundif (appState != UIApplicationStateBackground) {[ACPCore lifecycleStart:nil];}}];...return YES;}@end
Android
Copied to your clipboardimport com.adobe.marketing.mobile.AdobeCallback;import com.adobe.marketing.mobile.Identity;import com.adobe.marketing.mobile.InvalidInitException;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 android.app.Application;...public class MainApplication extends Application implements ReactApplication {...@Overridepublic void on Create(){super.onCreate();...MobileCore.setApplication(this);MobileCore.setLogLevel(LoggingMode.DEBUG);MobileCore.setWrapperType(WrapperType.REACT_NATIVE);try {UserProfile.registerExtension();Identity.registerExtension();Lifecycle.registerExtension();Signal.registerExtension();MobileCore.start(new AdobeCallback () {@Overridepublic void call(Object o) {MobileCore.configureWithAppID("<your_environment_id_from_Launch>");}});} catch (InvalidInitException e) {...}}}
Dart
For Flutter apps, initialize the SDK using native code in your AppDelegate and MainApplication in iOS and Android, respectively.
The initialization code is located in the Flutter ACPCore Github README.
For Cordova apps, initialize the SDK using native code in your AppDelegate and MainApplication in iOS and Android, respectively.
iOS
Copied to your clipboard// Import the SDK#import "ACPCore.h"#import "ACPLifecycle.h"#import "ACPIdentity.h"#import "ACPSignal.h"- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {// make sure to set the wrapper type at the beginning of initialization[ACPCore setWrapperType:ACPMobileWrapperTypeCordova];//...[ACPCore configureWithAppId:@"yourAppId"];[ACPIdentity registerExtension];[ACPLifecycle registerExtension];[ACPSignal registerExtension];// Register any additional extensions[ACPCore start:nil];}
Android
Copied to your clipboard// Import the SDKimport com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Identity;import com.adobe.marketing.mobile.Lifecycle;import com.adobe.marketing.mobile.Signal;import com.adobe.marketing.mobile.WrapperType;@Overridepublic void onCreate() {//...MobileCore.setApplication(this);MobileCore.configureWithAppID("yourAppId");// make sure to set the wrapper type at the beginning of initializationMobileCore.setWrapperType(WrapperType.CORDOVA);try {Identity.registerExtension();Lifecycle.registerExtension();Signal.registerExtension();// Register any additional extensions} catch (Exception e) {// handle exception}MobileCore.start(null);}
C#
For Unity apps, initialize the SDK using the following code in the start function of the MainScript.
Copied to your clipboardusing com.adobe.marketing.mobile;using using AOT;public class MainScript : MonoBehaviour{[MonoPInvokeCallback(typeof(AdobeStartCallback))]public static void HandleStartAdobeCallback(){ACPCore.ConfigureWithAppID("1423ae38-8385-8963-8693-28375403491d");}// Start is called before the first frame updatevoid Start(){if (Application.platform == RuntimePlatform.Android) {ACPCore.SetApplication();}ACPCore.SetLogLevel(ACPCore.ACPMobileLogLevel.VERBOSE);ACPCore.SetWrapperType();ACPIdentity.registerExtension();ACPLifecycle.registerExtension();ACPSignal.registerExtension();ACPCore.Start(HandleStartAdobeCallback);}}
C#
For Xamarin Forms applications, the SDK initialization differs, depending on the platform being targeted.
iOS
Copied to your clipboardusing Com.Adobe.Marketing.Mobile;[Register("AppDelegate")]public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate{//// This method is invoked when the application has loaded and is ready to run. In this// method you should instantiate the window, load the UI into it and then make the window// visible.//// You have 17 seconds to return from this method, or iOS will terminate your application.//public override bool FinishedLaunching(UIApplication app, NSDictionary options){global::Xamarin.Forms.Forms.Init();LoadApplication(new App());// set the wrapper typeACPCore.SetWrapperType(ACPMobileWrapperType.Xamarin);// set launch configACPCore.ConfigureWithAppID("your-app-id");// register SDK extensionsACPIdentity.RegisterExtension();ACPLifecycle.RegisterExtension();ACPSignal.RegisterExtension();// start coreACPCore.Start(null);}
Android
Copied to your clipboardusing Com.Adobe.Marketing.Mobile;[Activity(Label = "TestApp", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity{protected override void OnCreate(Bundle savedInstanceState){base.OnCreate(savedInstanceState);global::Xamarin.Forms.Forms.Init(this, savedInstanceState);LoadApplication(new App());// set the wrapper typeACPCore.SetWrapperType(WrapperType.Xamarin);// register SDK extensionsACPCore.Application = this.Application;ACPIdentity.RegisterExtension();ACPLifecycle.RegisterExtension();ACPSignal.RegisterExtension();// start coreACPCore.Start(null);}