Add the required dependencies to your project by including them in the app's Gradle file.
Copied to your clipboardimplementation(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")
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
Copied to your clipboardimplementation 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'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
Add the required dependencies to your project using CocoaPods. Add following pods in your Podfile
:
Copied to your clipboarduse_frameworks!target 'YourTargetApp' dopod 'AEPCore', '~> 5.0'pod 'AEPAnalytics', '~> 5.0'pod 'AEPIdentity', '~> 5.0'end
Java
Syntax
Copied to your clipboardcdata.put("&&events", "event1:12341234");
Example
Copied to your clipboard//create a context data dictionaryHashMap cdata = new HashMap<String, Object>();// add eventscdata.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 dictionaryval 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 clipboardcontextdata["&&events"] = "event1:12341234"
Example
Copied to your clipboard//create a context data dictionaryvar contextData = [String: Any]()// add eventscontextData["&&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 dictionaryNSMutableDictionary *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 clipboardHashMap<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 clipboardval 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 clipboardlet 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 clipboardNSDictionary *updatedConfig = @{@"analytics.server":@"sample.analytics.tracking.server",@"analytics.rsids":@"rsid1,rsid2",@"analytics.batchLimit":@(10),@"analytics.offlineEnabled":@YES};[AEPMobileCore updateConfiguration:updatedConfig];