Edit in GitHubLog an issue

Add the required dependencies to your project by including them in the app's Gradle file.

Copied to your clipboard
implementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+"))
implementation("com.adobe.marketing.mobile:core")
implementation("com.adobe.marketing.mobile:identity")
implementation("com.adobe.marketing.mobile:analytics")
Copied to your clipboard
implementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')
implementation 'com.adobe.marketing.mobile:core'
implementation 'com.adobe.marketing.mobile:identity'
implementation 'com.adobe.marketing.mobile:analytics'
now works

Add the required dependencies to your project using CocoaPods. Add following pods in your Podfile:

Copied to your clipboard
use_frameworks!
target 'YourTargetApp' do
pod 'AEPCore', '~> 5.0'
pod 'AEPAnalytics', '~> 5.0'
pod 'AEPIdentity', '~> 5.0'
end

Java

Syntax

Copied to your clipboard
cdata.put("&&events", "event1:12341234");

Example

Copied to your clipboard
//create a context data dictionary
HashMap cdata = new HashMap<String, Object>();
// add events
cdata.put("&&events", "event1:12341234");
// send a tracking call - use either a trackAction or TrackState call.
// trackAction example:
MobileCore.trackAction("Action Name", cdata);
// trackState example:
MobileCore.trackState("State Name", cdata);

Kotlin

Example

Copied to your clipboard
//create a context data dictionary
val cdata: Map<String, Any?> = mapOf(
"&&events" to "event1:12341234"
)
// send a tracking call - use either a trackAction or TrackState call.
// trackAction example:
MobileCore.trackAction("Action Name", cdata);
// trackState example:
MobileCore.trackState("State Name", cdata);

Swift

Syntax

Copied to your clipboard
contextdata["&&events"] = "event1:12341234"

Example

Copied to your clipboard
//create a context data dictionary
var contextData = [String: Any]()
// add events
contextData["&&events"] = "event1:12341234"
// send the tracking call - use either a trackAction or trackState call.
// trackAction example:
MobileCore.track(action: "Action Name" as String, data: contextData)
// trackState example:
MobileCore.track(state: "State Name" as String, data: contextData)

Objective-C

Syntax

Copied to your clipboard
[contextData setObject:@"eventN:serial number" forKey:@"&&events"];

Example

Copied to your clipboard
//create a context data dictionary
NSMutableDictionary *contextData = [NSMutableDictionary dictionary];
// add events
[contextData setObject:@"event1:12341234" forKey:@"&&events"];
// send the tracking call - use either a trackAction or trackState call.
// trackAction example:
[AEPMobileCore trackAction:@"Action Name" data:contextData];
// trackState example:
[AEPMobileCore trackState:@"State Name" data:contextData];

Java

Example

Copied to your clipboard
HashMap<String, Object> data = new HashMap<String, Object>();
data.put("analytics.server", "sample.analytics.tracking.server");
data.put("analytics.rsids", "rsid1,rsid2");
data.put("analytics.batchLimit", 10);
data.put("analytics.offlineEnabled", true);
MobileCore.updateConfiguration(data);

Kotlin

Example

Copied to your clipboard
val data: Map<String, Any?> = mapOf(
"analytics.server" to "sample.analytics.tracking.server",
"analytics.rsids" to "rsid1,rsid2",
"analytics.batchLimit" to 10,
"analytics.offlineEnabled" to true
)
MobileCore.updateConfiguration(data)

Swift

Example

Copied to your clipboard
let updatedConfig = ["analytics.server":"sample.analytics.tracking.server",
"analytics.rsids":"rsid1,rsid2",
"analytics.batchLimit":10,
"analytics.offlineEnabled":true] as [String: Any]
MobileCore.updateConfigurationWith(configDict: updatedConfig)

Objective-C

Example

Copied to your clipboard
NSDictionary *updatedConfig = @{@"analytics.server":@"sample.analytics.tracking.server",
@"analytics.rsids":@"rsid1,rsid2",
@"analytics.batchLimit":@(10),
@"analytics.offlineEnabled":@YES};
[AEPMobileCore updateConfiguration:updatedConfig];
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2025 Adobe. All rights reserved.