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.
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
UserProfile
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:userprofile")
Groovy
Copied to your clipboardimplementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')implementation 'com.adobe.marketing.mobile:core'implementation 'com.adobe.marketing.mobile:userprofile'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
- Import the
UserProfile
library and any other SDK library in your application's main activity.
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.UserProfile;
- 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 'AEPCore', '~> 5.0'pod 'AEPUserProfile', '~> 5.0'end
- Import the UserProfile library.
Swift
Copied to your clipboardimport AEPCoreimport AEPUserProfile
Objective-C
Copied to your clipboard@import AEPCore;@import AEPUserProfile;
- Add the
UserProfile
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:userprofile")
Groovy
Copied to your clipboardimplementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')implementation 'com.adobe.marketing.mobile:core'implementation 'com.adobe.marketing.mobile:userprofile'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
- Import the
UserProfile
library and any other SDK library in your application's main activity.
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.UserProfile;
- 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 'AEPCore', '~> 5.0'pod 'AEPUserProfile', '~> 5.0'end
- Import the UserProfile library.
Swift
Copied to your clipboardimport AEPCoreimport AEPUserProfile
Objective-C
Copied to your clipboard@import AEPCore;@import AEPUserProfile;
Register the extension
After calling the setApplication()
method in the onCreate()
method, register the UserProfile extension.
- The
UserProfile
extension must be registered with Mobile Core before calling anUserProfile
API.
Java
Copied to your clipboardpublic class MobileApp extends Application {@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);List<Class<? extends Extension>> extensions = Arrays.asList(UserProfile.EXTENSION, ...);MobileCore.registerExtensions(extensions, o -> {// Any other post registration processing});}}
Kotlin
Copied to your clipboardclass MyApp : Application() {override fun onCreate() {super.onCreate()MobileCore.setApplication(this)MobileCore.setLogLevel(LoggingMode.VERBOSE)MobileCore.configureWithAppID("YOUR_APP_ID")val extensions = listOf(UserProfile.EXTENSION, ...)MobileCore.registerExtensions(extensions) {Log.d(LOG_TAG, "AEP Mobile SDK is initialized")}}}
Swift
Copied to your clipboard// AppDelegate.swiftfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {MobileCore.registerExtensions([UserProfile.self], {})...}
Objective-C
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[AEPMobileCore registerExtensions:@AEPMobileUserProfile.class] completion:^{...}];...// Override point for customization after application launch.return YES;}
After calling the setApplication()
method in the onCreate()
method, register the UserProfile extension.
- The
UserProfile
extension must be registered with Mobile Core before calling anUserProfile
API.
Java
Copied to your clipboardpublic class MobileApp extends Application {@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);List<Class<? extends Extension>> extensions = Arrays.asList(UserProfile.EXTENSION, ...);MobileCore.registerExtensions(extensions, o -> {// Any other post registration processing});}}
Kotlin
Copied to your clipboardclass MyApp : Application() {override fun onCreate() {super.onCreate()MobileCore.setApplication(this)MobileCore.setLogLevel(LoggingMode.VERBOSE)MobileCore.configureWithAppID("YOUR_APP_ID")val extensions = listOf(UserProfile.EXTENSION, ...)MobileCore.registerExtensions(extensions) {Log.d(LOG_TAG, "AEP Mobile SDK is initialized")}}}
Swift
Copied to your clipboard// AppDelegate.swiftfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {MobileCore.registerExtensions([UserProfile.self], {})...}
Objective-C
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[AEPMobileCore registerExtensions:@AEPMobileUserProfile.class] completion:^{...}];...// Override point for customization after application launch.return YES;}