Profile
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.
Important: The Profile extension does not require any configuration.
To get started with the Profile extension:
  1. 1.
    Configure the Profile Extension in Launch.
  2. 2.
    Add the Profile extension to your app.
  3. 3.
    Implement Profile APIs to:
    • Update user attributes.
    • Remove user attributes.

Add Profile to your App

To add the Profile extension to your app:
Android
iOS (AEP 3.x)
iOS (ACP 2.x)
Cordova
Flutter

Java

  1. 1.
    Add the UserProfile library to your project using the app's gradle file.
  2. 2.
    Import the UserProfile library and any other SDK library in your application's main activity.
    1
    import com.adobe.marketing.mobile.*;
    Copied!
  1. 1.
    Add the UserProfile library to your project via your Podfile by adding pod 'AEPUserProfile'.
  2. 2.
    Import the UserProfile library.

Swift

1
import AEPUserProfile
Copied!

Objective C

1
@import AEPUserProfile;
Copied!

Objective C

  1. 1.
    Add the UserProfile library to your project via your Podfile by adding pod 'ACPUserProfile'.
  2. 2.
    Import the UserProfile and Identity library.
1
#import "ACPCore.h"
2
#import "ACPUserProfile.h"
Copied!

Swift

1
import ACPCore
2
import ACPUserProfile
Copied!

Cordova

  1. 1.
    After creating your Cordova app and adding the Android and iOS platforms, the User Profile extension for Cordova can be added with this command:
    1
    cordova plugin add https://github.com/adobe/cordova-acpuserprofile.git
    Copied!
  2. 2.
    Get the extension version.
    1
    ACPUserProfile.extensionVersion(function(version) {
    2
    console.log("ACPUserProfile version: " + version);
    3
    }, function(error) {
    4
    console.log(error);
    5
    });
    Copied!

Flutter

  1. 1.
    After creating your Flutter app and adding the Android and iOS platforms, the User Profile extension for flutter can be added in the pubspec.yaml:
    1
    dependencies:
    2
    flutter_acpcore: ">= 1.0.0"
    3
    flutter_acpuserprofile: ">= 1.0.0"
    Copied!
Then fetch the packages with:
1
flutter pub get
Copied!
  1. 1.
    Get the extension version.
    1
    import 'package:flutter_acpuserprofile/flutter_acpuserprofile.dart';
    2
    String version = FlutterACPUserProfile.extensionVersion;
    Copied!

Xamarin

  1. 1.
    After adding the iOS or Android ACPUserProfile NuGet package, the User Profile extension for Xamarin can be added by this import statement:
    1
    using Com.Adobe.Marketing.Mobile;
    Copied!
  2. 2.
    Get the extension version.
    1
    ACPUserProfile.ExtensionVersion();
    Copied!

Register the extension

Android
iOS (AEP 3.x)
iOS (ACP 2.x)
Cordova
Flutter
Xamarin

Java

Required: The setApplication() method must be called once in the onCreate() method of your main activity.
  1. 1.
    The UserProfile extension must be registered with Mobile Core before calling an UserProfile API.
    This can be done after calling setApplication() in the onCreate() method. Here is a code sample, which calls these set up methods:
1
public class MobileApp extends Application {
2
3
@Override
4
public void onCreate() {
5
super.onCreate();
6
MobileCore.setApplication(this);
7
8
try {
9
UserProfile.registerExtension();
10
} catch (Exception e) {
11
//Log the exception
12
}
13
}
14
}
Copied!

Objective C

Required: You must complete the following steps in the app before calling other UserProfile APIs.
  1. 1.
    In your app's didFinishLaunchingWithOptions function register the UserProfile extension.
1
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
2
[AEPMobileCore registerExtensions:@AEPMobileUserProfile.class] completion:^{
3
...
4
}];
5
...
6
// Override point for customization after application launch.
7
return YES;
8
}
Copied!

Swift

1
// AppDelegate.swift
2
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
3
MobileCore.registerExtensions([UserProfile.self], {
4
})
5
...
6
}
Copied!

Objective C

Required: You must complete the following steps in the app before calling other UserProfile APIs.
  1. 1.
    In your app's didFinishLaunchingWithOptions function register the UserProfile extension.
1
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
2
[ACPUserProfile registerExtension];
3
// Override point for customization after application launch.
4
return YES;
5
}
Copied!

Cordova

When using Cordova, register AEP Assurance with Mobile Core in native code as shown on the Android and iOS tabs.

Flutter

When using Flutter, register AEP Assurance with Mobile Core in native code as shown on the Android and iOS tabs.

Xamarin

C#

iOS
Register the User Profile extension in your app's FinishedLaunching() function:
1
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
2
{
3
global::Xamarin.Forms.Forms.Init();
4
LoadApplication(new App());
5
ACPUserProfile.RegisterExtension();
6
// start core
7
ACPCore.Start(startCallback);
8
return base.FinishedLaunching(app, options);
9
}
10
11
private void startCallback()
12
{
13
// set launch config
14
ACPCore.ConfigureWithAppID("yourAppId");
15
}
Copied!
Android
Register the User Profile extension in your app's OnCreate() function:
1
protected override void OnCreate(Bundle savedInstanceState)
2
{
3
base.OnCreate(savedInstanceState);
4
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
5
LoadApplication(new App());
6
ACPUserProfile.RegisterExtension();
7
8
// start core
9
ACPCore.Start(new CoreStartCompletionCallback());
10
}
11
12
class CoreStartCompletionCallback : Java.Lang.Object, IAdobeCallback
13
{
14
public void Call(Java.Lang.Object callback)
15
{
16
// set launch config
17
ACPCore.ConfigureWithAppID("yourAppId");
18
}
19
}
Copied!
Last modified 2mo ago
Export as PDF
Copy link