Profile
This document lists information about the previous versions of the Adobe Experience Platform Mobile SDKs. Check out this page for latest versions and solution support of the Mobile SDKs.
You can use the Profile extension to store attributes about your user on the client. This information can be used later to target and personalize messages during online or offline scenarios, without having to connect to a server for optimal performance. The Profile extension manages the Client-Side Operation Profile (CSOP) and provides a way to react to APIs, updates user profile attributes, and shares the user profile attributes with the rest of the system as a generated event.
The Profile data is used by other extensions to perform profile-related actions. An example is the Rules Engine extension that consumes the profile data and runs rules based on the profile data.
The Profile extension does not require any configuration.
To get started with the Profile extension:
- Configure the Profile Extension in the Data Collection UI.
- Add the Profile extension to your app.
- Implement Profile APIs to:
- Update user attributes.
- Remove user attributes.
Install the Profile extension in the Data Collection UI
- In the Data Collection UI, in your mobile property, select the Extensions tab.
- On the Catalog tab, locate or search for the Profile extension, and select Install.
- There are no configuration settings for Profile.
- Select Save.
- Follow the publishing process to update SDK configuration.
Add the Profile extension to your app
To add the Profile extension to your app:
- Add the Mobile Core and Profile extensions to your project using Cocoapods. Add following pods in your
Podfile
:
Copied to your clipboarduse_frameworks!target 'YourTargetApp' dopod 'ACPCore'pod 'ACPUserProfile'end
- Import the UserProfile library.
Objective-C
Copied to your clipboard#import "ACPCore.h"#import "ACPUserProfile.h"
Swift
Copied to your clipboardimport ACPCoreimport ACPUserProfile
C#
After importing the ACPUserProfile.unitypackage, the UserProfile extension for Unity can be added with following code in the MainScript
Copied to your clipboardusing com.adobe.marketing.mobile;
Java
Add the
UserProfile
library to your project using the app's gradle file.Import the
UserProfile
library and any other SDK library in your application's main activity.
Copied to your clipboardimport com.adobe.marketing.mobile.*;
- Add the Mobile Core and Profile extensions to your project using Cocoapods. Add following pods in your
Podfile
:
Copied to your clipboarduse_frameworks!target 'YourTargetApp' dopod 'ACPCore'pod 'ACPUserProfile'end
- Import the UserProfile library.
Objective-C
Copied to your clipboard#import "ACPCore.h"#import "ACPUserProfile.h"
Swift
Copied to your clipboardimport ACPCoreimport ACPUserProfile
Cordova
After creating your Cordova app and adding the Android and iOS platforms, the UserProfile extension for Cordova can be added with this command:
Copied to your clipboardcordova plugin add https://github.com/adobe/cordova-acpuserprofile.git
C#
After importing the ACPUserProfile.unitypackage, the UserProfile extension for Unity can be added with following code in the MainScript
Copied to your clipboardusing com.adobe.marketing.mobile;
Register the extension
Java
Required: The setApplication()
method must be called once in the onCreate()
method of your main activity.
- The
UserProfile
extension must be registered with Mobile Core before calling anUserProfile
API.
This can be done after calling setApplication()
in the onCreate()
method. Here is a code sample, which calls these set up methods:
Copied to your clipboardpublic class MobileApp extends Application {@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);try {// register other extensionsUserProfile.registerExtension();MobileCore.start(new AdobeCallback () {@Overridepublic void call(Object o) {MobileCore.configureWithAppID("yourAppId");}});} catch (Exception e) {//Log the exception}}}
Swift
Copied to your clipboardfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {ACPCore.configure(withAppId: "yourAppId")ACPUserProfile.registerExtension()ACPCore.start(nil)// Override point for customization after application launch.return true;}
Objective-C
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[ACPUserProfile registerExtension];// Override point for customization after application launch.return YES;}
C#
Register the extension in the start()
function:
Copied to your clipboardusing com.adobe.marketing.mobile;using using AOT;public class MainScript : MonoBehaviour{[MonoPInvokeCallback(typeof(AdobeStartCallback))]public static void HandleStartAdobeCallback(){ACPCore.ConfigureWithAppID("yourAppId");}// Start is called before the first frame updatevoid Start(){ACPUserProfile.registerExtension();ACPCore.Start(HandleStartAdobeCallback);}}
C#
iOS
Register the User Profile extension in your app's FinishedLaunching()
function:
Copied to your clipboardpublic override bool FinishedLaunching(UIApplication app, NSDictionary options){global::Xamarin.Forms.Forms.Init();LoadApplication(new App());ACPUserProfile.RegisterExtension();// start coreACPCore.Start(startCallback);return base.FinishedLaunching(app, options);}private void startCallback(){// set launch configACPCore.ConfigureWithAppID("yourAppId");}
Android
Register the User Profile extension in your app's OnCreate()
function:
Copied to your clipboardprotected override void OnCreate(Bundle savedInstanceState){base.OnCreate(savedInstanceState);global::Xamarin.Forms.Forms.Init(this, savedInstanceState);LoadApplication(new App());ACPUserProfile.RegisterExtension();// start coreACPCore.Start(new CoreStartCompletionCallback());}class CoreStartCompletionCallback : Java.Lang.Object, IAdobeCallback{public void Call(Java.Lang.Object callback){// set launch configACPCore.ConfigureWithAppID("yourAppId");}}
Java
Required: The setApplication()
method must be called once in the onCreate()
method of your main activity.
- The
UserProfile
extension must be registered with Mobile Core before calling anUserProfile
API.
This can be done after calling setApplication()
in the onCreate()
method. Here is a code sample, which calls these set up methods:
Copied to your clipboardpublic class MobileApp extends Application {@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);try {// register other extensionsUserProfile.registerExtension();MobileCore.start(new AdobeCallback () {@Overridepublic void call(Object o) {MobileCore.configureWithAppID("yourAppId");}});} catch (Exception e) {//Log the exception}}}
Swift
Copied to your clipboardfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {ACPCore.configure(withAppId: "yourAppId")ACPUserProfile.registerExtension()ACPCore.start(nil)// Override point for customization after application launch.return true;}
Objective-C
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[ACPUserProfile registerExtension];// Override point for customization after application launch.return YES;}
JavaScript
When using React Native, register Profile with Mobile Core in native code as shown on the Android and iOS tabs.
Flutter
When using Flutter, register Profile with Mobile Core in native code as shown on the Android and iOS tabs.
Cordova
When using Cordova, register Profile with Mobile Core in native code as shown on the Android and iOS tabs.
C#
Register the extension in the start()
function:
Copied to your clipboardusing com.adobe.marketing.mobile;using using AOT;public class MainScript : MonoBehaviour{[MonoPInvokeCallback(typeof(AdobeStartCallback))]public static void HandleStartAdobeCallback(){ACPCore.ConfigureWithAppID("yourAppId");}// Start is called before the first frame updatevoid Start(){ACPUserProfile.registerExtension();ACPCore.Start(HandleStartAdobeCallback);}}
C#
iOS
Register the User Profile extension in your app's FinishedLaunching()
function:
Copied to your clipboardpublic override bool FinishedLaunching(UIApplication app, NSDictionary options){global::Xamarin.Forms.Forms.Init();LoadApplication(new App());ACPUserProfile.RegisterExtension();// start coreACPCore.Start(startCallback);return base.FinishedLaunching(app, options);}private void startCallback(){// set launch configACPCore.ConfigureWithAppID("yourAppId");}
Android
Register the User Profile extension in your app's OnCreate()
function:
Copied to your clipboardprotected override void OnCreate(Bundle savedInstanceState){base.OnCreate(savedInstanceState);global::Xamarin.Forms.Forms.Init(this, savedInstanceState);LoadApplication(new App());ACPUserProfile.RegisterExtension();// start coreACPCore.Start(new CoreStartCompletionCallback());}class CoreStartCompletionCallback : Java.Lang.Object, IAdobeCallback{public void Call(Java.Lang.Object callback){// set launch configACPCore.ConfigureWithAppID("yourAppId");}}