Edge Network API reference
extensionVersion
Returns the version of the client-side Edge extension.
Swift
Syntax
Copied to your clipboardstatic let extensionVersion
Example
Copied to your clipboardlet extensionVersion = Edge.extensionVersion
Objective-C
Syntax
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Example
Copied to your clipboardNSString *extensionVersion = [AEPMobileEdge extensionVersion];
Java
Syntax
Copied to your clipboardpublic static String extensionVersion();
Example
Copied to your clipboardString extensionVersion = Edge.extensionVersion();
Kotlin
Example
Copied to your clipboardval extensionVersion = EdgeBridge.extensionVersion()
Swift
Syntax
Copied to your clipboardstatic let extensionVersion
Example
Copied to your clipboardlet extensionVersion = Edge.extensionVersion
Objective-C
Syntax
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Example
Copied to your clipboardNSString *extensionVersion = [AEPMobileEdge extensionVersion];
getLocationHint
Gets the Edge Network location hint used in requests to the Adobe Experience Platform Edge Network. The Edge Network location hint may be used when building the URL for Adobe Experience Platform Edge Network requests to hint at the server cluster to use.
Java
Syntax
Copied to your clipboardpublic static void getLocationHint(final AdobeCallback<String> callback)
- callback is invoked with the location hint. The location hint value may be null if the location hint expired or was not set. The callback may be invoked on a different thread. If
AdobeCallbackWithError
is provided, the default timeout is 1000ms and thefail
method is called if the operation times out or an unexpected error occurs.
Example
Copied to your clipboardEdge.getLocationHint(new AdobeCallbackWithError<String>() {@Overridepublic void call(final String hint) {// Handle the hint here}@Overridepublic void fail(AdobeError adobeError) {// Handle the error here}});
Kotlin
Example
Copied to your clipboardEdge.getLocationHint(object: AdobeCallbackWithError<String> {override fun call(hint: String) {// Handle the hint here}override fun fail(error: AdobeError?) {// Handle the error here}})
Swift
Syntax
Copied to your clipboardstatic func getLocationHint(completion: @escaping (String?, Error?) -> Void)
- completion is invoked with the location hint, or an
AEPError
if the request times out or an unexpected error occurs. The location hint value may be nil if the location hint expired or was not set. The default timeout is 1000ms. The completion handler may be invoked on a different thread.
Example
Copied to your clipboardEdge.getLocationHint { (hint, error) inif let error = error {// Handle the error here} else {// Handle the location hint here}}
Objective-C
Syntax
Copied to your clipboard+ (void) getLocationHint:^(NSString * _Nullable hint, NSError * _Nullable error)completion
Example
Copied to your clipboard[AEPMobileEdge getLocationHint:^(NSString *hint, NSError *error) {// handle the error and the hint here}];
Java
Syntax
Copied to your clipboardpublic static void getLocationHint(final AdobeCallback<String> callback)
- callback is invoked with the location hint. The location hint value may be null if the location hint expired or was not set. The callback may be invoked on a different thread. If
AdobeCallbackWithError
is provided, the default timeout is 1000ms and thefail
method is called if the operation times out or an unexpected error occurs.
Example
Copied to your clipboardEdge.getLocationHint(new AdobeCallbackWithError<String>() {@Overridepublic void call(final String hint) {// Handle the hint here}@Overridepublic void fail(AdobeError adobeError) {// Handle the error here}});
Kotlin
Example
Copied to your clipboardEdge.getLocationHint(object: AdobeCallbackWithError<String> {override fun call(hint: String) {// Handle the hint here}override fun fail(error: AdobeError?) {// Handle the error here}})
Swift
Syntax
Copied to your clipboardstatic func getLocationHint(completion: @escaping (String?, Error?) -> Void)
- completion is invoked with the location hint, or an
AEPError
if the request times out or an unexpected error occurs. The location hint value may be nil if the location hint expired or was not set. The default timeout is 1000ms. The completion handler may be invoked on a different thread.
Example
Copied to your clipboardEdge.getLocationHint { (hint, error) inif let error = error {// Handle the error here} else {// Handle the location hint here}}
Objective-C
Syntax
Copied to your clipboard+ (void) getLocationHint:^(NSString * _Nullable hint, NSError * _Nullable error)completion
Example
Copied to your clipboard[AEPMobileEdge getLocationHint:^(NSString *hint, NSError *error) {// handle the error and the hint here}];
registerExtension
This API has been deprecated starting in v2.0.0 and removed in v3.0.0 of the Android mobile extension.
Use MobileCore.registerExtensions()
API instead.
resetIdentities
Resets current state of the AEP Edge extension and clears previously cached content related to current identity, if any.
See MobileCore.resetIdentities for more details.
sendEvent
Sends an Experience event to Adobe Experience Platform Edge Network.
Starting with Edge
extension version 2.4.0 (Android) and 4.3.0 (iOS), the sendEvent
API supports optional datastream overrides. This allows you to adjust your datastreams without the need for new ones or modifications to existing settings.
The process involves two steps:
- Define your Datastream configuration overrides on the datastream configuration page.
- Send these overrides to the Edge Network using the
sendEvent
API.
Java
Syntax
Copied to your clipboardpublic static void sendEvent(final ExperienceEvent experienceEvent,final EdgeCallback callback);
- experienceEvent - the XDM Experience Event to be sent to Adobe Experience Platform Edge Network
- completion - optional callback to be invoked when the request is complete, returning the associated EdgeEventHandle(s) received from the Adobe Experience Platform Edge Network. It may be invoked on a different thread.
Example
Copied to your clipboard// Create Experience Event from mapMap<String, Object> xdmData = new HashMap<>();xdmData.put("eventType", "SampleXDMEvent");xdmData.put("sample", "data");ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(xdmData).build();
Copied to your clipboard// Example 1 - send the Experience Event without handling the Edge Network responseEdge.sendEvent(experienceEvent, null);
Copied to your clipboard// Example 2 - send the Experience Event and handle the Edge Network response onCompleteEdge.sendEvent(experienceEvent, new EdgeCallback() {@Overridepublic void onComplete(final List<EdgeEventHandle> handles) {// Handle the Edge Network response}});
Example with Datastream ID override
Copied to your clipboard// Create experience event from MapMap<String, Object> xdmData = new HashMap<>();xdmData.put("eventType", "SampleXDMEvent");xdmData.put("sample", "data");ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(xdmData).setDatastreamIdOverride("SampleDatastreamId").build();Edge.sendEvent(experienceEvent, new EdgeCallback() {@Overridepublic void onComplete(final List<EdgeEventHandle> handles) {// Handle the Edge Network response}});
Example with Datastream config override
Copied to your clipboard// ----------------- Datastream config overrides map start -----------------Map<String, Object> configOverrides = new HashMap<>();// com_adobe_experience_platformMap<String, Object> experiencePlatform = new HashMap<>();Map<String, Object> datasets = new HashMap<>();Map<String, Object> eventDataset = new HashMap<>();eventDataset.put("datasetId", "SampleEventDatasetIdOverride");datasets.put("event", eventDataset);experiencePlatform.put("datasets", datasets);configOverrides.put("com_adobe_experience_platform", experiencePlatform);// com_adobe_analyticsMap<String, Object> analytics = new HashMap<>();analytics.put("reportSuites", new String[]{"rsid1", "rsid2", "rsid3"});configOverrides.put("com_adobe_analytics", analytics);// com_adobe_identityMap<String, Object> identity = new HashMap<>();identity.put("idSyncContainerId", "1234567");configOverrides.put("com_adobe_identity", identity);// com_adobe_targetMap<String, Object> target = new HashMap<>();target.put("propertyToken", "SamplePropertyToken");configOverrides.put("com_adobe_target", target);// ----------------- Datastream config overrides map end -----------------// Create experience event from MapMap<String, Object> xdmData = new HashMap<>();xdmData.put("eventType", "SampleXDMEvent");xdmData.put("sample", "data");ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(xdmData).setDatastreamConfigOverride(configOverrides).build();Edge.sendEvent(experienceEvent, new EdgeCallback() {@Overridepublic void onComplete(final List<EdgeEventHandle> handles) {// Handle the Edge Network response}});
Kotlin
Example
Copied to your clipboard// Create Experience Event from mapval xdmData = mutableMapOf<String, Any>()xdmData["eventType"] = "SampleXDMEvent"xdmData["sample"] = "data"val experienceEvent = ExperienceEvent.Builder().setXdmSchema(xdmData).build()
Copied to your clipboard// Example 1 - send the Experience Event without handling the Edge Network responseEdge.sendEvent(experienceEvent, null)
Copied to your clipboard// Example 2 - send the Experience Event and handle the Edge Network response onCompleteEdge.sendEvent(experienceEvent) {// Handle the Edge Network response}
Example with Datastream ID override
Copied to your clipboard// Create experience event from Mapval xdmData = mutableMapOf<String, Any>()xdmData["eventType"] = "SampleXDMEvent"xdmData["sample"] = "data"val experienceEvent = ExperienceEvent.Builder().setXdmSchema(xdmData).setDatastreamIdOverride("SampleDatastreamId").build()Edge.sendEvent(experienceEvent) {// Handle the Edge Network response}
Example with Datastream config override
Copied to your clipboard// Create experience event from Mapval xdmData = mutableMapOf<String, Any>()xdmData["eventType"] = "SampleXDMEvent"xdmData["sample"] = "data"val configOverrides = mapOf("com_adobe_experience_platform" to mapOf("datasets" to mapOf("event" to mapOf("datasetId" to "SampleEventDatasetIdOverride"))),"com_adobe_analytics" to mapOf("reportSuites" to listOf("rsid1", "rsid2", "rsid3")),"com_adobe_identity" to mapOf("idSyncContainerId" to "1234567"),"com_adobe_target" to mapOf("propertyToken" to "SamplePropertyToken"))val experienceEvent = ExperienceEvent.Builder().setXdmSchema(xdmData).setDatastreamConfigOverride(configOverrides).build()Edge.sendEvent(experienceEvent) {// Handle the Edge Network response}
Swift
Syntax
Copied to your clipboardstatic func sendEvent(experienceEvent: ExperienceEvent, _ completion: (([EdgeEventHandle]) -> Void)? = nil)
- experienceEvent - the XDM Experience Event to be sent to Adobe Experience Platform Edge Network
- completion - optional callback to be invoked when the request is complete, returning the associated EdgeEventHandle(s) received from the Adobe Experience Platform Edge Network. It may be invoked on a different thread.
Example
Copied to your clipboard// Create Experience Event from dictionary:var xdmData : [String: Any] = ["eventType" : "SampleXDMEvent","sample": "data"]let experienceEvent = ExperienceEvent(xdm: xdmData)
Copied to your clipboard// Example 1 - send the Experience Event without handling the Edge Network responseEdge.sendEvent(experienceEvent: experienceEvent)
Copied to your clipboard// Example 2 - send the Experience Event and handle the Edge Network response onCompleteEdge.sendEvent(experienceEvent: experienceEvent) { (handles: [EdgeEventHandle]) in// Handle the Edge Network response}
Example with Datastream ID override
Copied to your clipboard// Create Experience event from dictionaryvar xdmData : [String: Any] = ["eventType" : "SampleXDMEvent","sample": "data"]let experienceEvent = ExperienceEvent(xdm: xdmData, datastreamIdOverride: "SampleDatastreamId")Edge.sendEvent(experienceEvent: experienceEvent) { (handles: [EdgeEventHandle]) in// Handle the Edge Network response}
Example with Datastream config override
Copied to your clipboard// Create Experience event from dictionaryvar xdmData : [String: Any] = ["eventType" : "SampleXDMEvent","sample": "data"]let configOverrides: [String: Any] = ["com_adobe_experience_platform": ["datasets": ["event": ["datasetId": "SampleEventDatasetIdOverride"]]],"com_adobe_analytics": ["reportSuites": ["rsid1","rsid2","rsid3"]],"com_adobe_identity": ["idSyncContainerId": "1234567"],"com_adobe_target": ["propertyToken": "SamplePropertyToken"]]let experienceEvent = ExperienceEvent(xdm: xdmData, datastreamConfigOverride: configOverrides)Edge.sendEvent(experienceEvent: experienceEvent) { (handles: [EdgeEventHandle]) in// Handle the Edge Network response}
Objective-C
Syntax
Copied to your clipboard+ (void) sendExperienceEvent:(AEPExperienceEvent * _Nonnull) completion:^(NSArray<AEPEdgeEventHandle *> * _Nonnull)completion
Example
Copied to your clipboard// Create Experience Event from dictionary:NSDictionary *xdmData = @{ @"eventType" : @"SampleXDMEvent"};NSDictionary *data = @{ @"sample" : @"data"};
Copied to your clipboard// Example 1 - send the Experience Event without handling the Edge Network response[AEPMobileEdge sendExperienceEvent:event completion:nil];
Copied to your clipboard// Example 2 - send the Experience Event and handle the Edge Network response onComplete[AEPMobileEdge sendExperienceEvent:event completion:^(NSArray<AEPEdgeEventHandle *> * _Nonnull handles) {// handle the Edge Network response}];
Example with Datastream ID override
Copied to your clipboard// Create Experience event from dictionary:NSDictionary *xdmData = @{ @"eventType" : @"SampleXDMEvent"};NSDictionary *data = @{ @"sample" : @"data"};AEPExperienceEvent* event = [[AEPExperienceEvent alloc]initWithXdm:xdmData data:data datastreamIdOverride: @"SampleDatastreamIdOverride"];[AEPMobileEdge sendExperienceEvent:event completion:^(NSArray<AEPEdgeEventHandle *> * _Nonnull handles) {// Handle the Edge Network response}];
Example with Datastream config override
Copied to your clipboard// Create Experience event from dictionary:NSDictionary *xdmData = @{ @"eventType" : @"SampleXDMEvent"};NSDictionary *data = @{ @"sample" : @"data"};NSDictionary *configOverrides = @{ @"com_adobe_experience_platform" : @{@"datasets" : @{@"event" : @{@"datasetId": @"SampleEventDatasetIdOverride"}}},@"com_adobe_analytics" : @{@"reportSuites" : @[@"rsid1",@"rsid2",@"rsid3",]},@"com_adobe_identity" : @{@"idSyncContainerId": @"1234567"},@"com_adobe_target" : @{@"propertyToken": @"SamplePropertyToken"}}AEPExperienceEvent* event = [[AEPExperienceEvent alloc]initWithXdm:xdmData data:data datastreamConfigOverride: configOverrides];[AEPMobileEdge sendExperienceEvent:event completion:^(NSArray<AEPEdgeEventHandle *> * _Nonnull handles) {// Handle the Edge Network response}];
Java
Syntax
Copied to your clipboardpublic static void sendEvent(final ExperienceEvent experienceEvent,final EdgeCallback callback);
- experienceEvent - the XDM Experience Event to be sent to Adobe Experience Platform Edge Network
- completion - optional callback to be invoked when the request is complete, returning the associated EdgeEventHandle(s) received from the Adobe Experience Platform Edge Network. It may be invoked on a different thread.
Example
Copied to your clipboard// Create Experience Event from mapMap<String, Object> xdmData = new HashMap<>();xdmData.put("eventType", "SampleXDMEvent");xdmData.put("sample", "data");ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(xdmData).build();
Copied to your clipboard// Example 1 - send the Experience Event without handling the Edge Network responseEdge.sendEvent(experienceEvent, null);
Copied to your clipboard// Example 2 - send the Experience Event and handle the Edge Network response onCompleteEdge.sendEvent(experienceEvent, new EdgeCallback() {@Overridepublic void onComplete(final List<EdgeEventHandle> handles) {// Handle the Edge Network response}});
Example with Datastream ID override
Copied to your clipboard// Create experience event from MapMap<String, Object> xdmData = new HashMap<>();xdmData.put("eventType", "SampleXDMEvent");xdmData.put("sample", "data");ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(xdmData).setDatastreamIdOverride("SampleDatastreamId").build();Edge.sendEvent(experienceEvent, new EdgeCallback() {@Overridepublic void onComplete(final List<EdgeEventHandle> handles) {// Handle the Edge Network response}});
Example with Datastream config override
Copied to your clipboard// ----------------- Datastream config overrides map start -----------------Map<String, Object> configOverrides = new HashMap<>();// com_adobe_experience_platformMap<String, Object> experiencePlatform = new HashMap<>();Map<String, Object> datasets = new HashMap<>();Map<String, Object> eventDataset = new HashMap<>();eventDataset.put("datasetId", "SampleEventDatasetIdOverride");datasets.put("event", eventDataset);experiencePlatform.put("datasets", datasets);configOverrides.put("com_adobe_experience_platform", experiencePlatform);// com_adobe_analyticsMap<String, Object> analytics = new HashMap<>();analytics.put("reportSuites", new String[]{"rsid1", "rsid2", "rsid3"});configOverrides.put("com_adobe_analytics", analytics);// com_adobe_identityMap<String, Object> identity = new HashMap<>();identity.put("idSyncContainerId", "1234567");configOverrides.put("com_adobe_identity", identity);// com_adobe_targetMap<String, Object> target = new HashMap<>();target.put("propertyToken", "SamplePropertyToken");configOverrides.put("com_adobe_target", target);// ----------------- Datastream config overrides map end -----------------// Create experience event from MapMap<String, Object> xdmData = new HashMap<>();xdmData.put("eventType", "SampleXDMEvent");xdmData.put("sample", "data");ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(xdmData).setDatastreamConfigOverride(configOverrides).build();Edge.sendEvent(experienceEvent, new EdgeCallback() {@Overridepublic void onComplete(final List<EdgeEventHandle> handles) {// Handle the Edge Network response}});
Kotlin
Example
Copied to your clipboard// Create Experience Event from mapval xdmData = mutableMapOf<String, Any>()xdmData["eventType"] = "SampleXDMEvent"xdmData["sample"] = "data"val experienceEvent = ExperienceEvent.Builder().setXdmSchema(xdmData).build()
Copied to your clipboard// Example 1 - send the Experience Event without handling the Edge Network responseEdge.sendEvent(experienceEvent, null)
Copied to your clipboard// Example 2 - send the Experience Event and handle the Edge Network response onCompleteEdge.sendEvent(experienceEvent) {// Handle the Edge Network response}
Example with Datastream ID override
Copied to your clipboard// Create experience event from Mapval xdmData = mutableMapOf<String, Any>()xdmData["eventType"] = "SampleXDMEvent"xdmData["sample"] = "data"val experienceEvent = ExperienceEvent.Builder().setXdmSchema(xdmData).setDatastreamIdOverride("SampleDatastreamId").build()Edge.sendEvent(experienceEvent) {// Handle the Edge Network response}
Example with Datastream config override
Copied to your clipboard// Create experience event from Mapval xdmData = mutableMapOf<String, Any>()xdmData["eventType"] = "SampleXDMEvent"xdmData["sample"] = "data"val configOverrides = mapOf("com_adobe_experience_platform" to mapOf("datasets" to mapOf("event" to mapOf("datasetId" to "SampleEventDatasetIdOverride"))),"com_adobe_analytics" to mapOf("reportSuites" to listOf("rsid1", "rsid2", "rsid3")),"com_adobe_identity" to mapOf("idSyncContainerId" to "1234567"),"com_adobe_target" to mapOf("propertyToken" to "SamplePropertyToken"))val experienceEvent = ExperienceEvent.Builder().setXdmSchema(xdmData).setDatastreamConfigOverride(configOverrides).build()Edge.sendEvent(experienceEvent) {// Handle the Edge Network response}
Swift
Syntax
Copied to your clipboardstatic func sendEvent(experienceEvent: ExperienceEvent, _ completion: (([EdgeEventHandle]) -> Void)? = nil)
- experienceEvent - the XDM Experience Event to be sent to Adobe Experience Platform Edge Network
- completion - optional callback to be invoked when the request is complete, returning the associated EdgeEventHandle(s) received from the Adobe Experience Platform Edge Network. It may be invoked on a different thread.
Example
Copied to your clipboard// Create Experience Event from dictionary:var xdmData : [String: Any] = ["eventType" : "SampleXDMEvent","sample": "data"]let experienceEvent = ExperienceEvent(xdm: xdmData)
Copied to your clipboard// Example 1 - send the Experience Event without handling the Edge Network responseEdge.sendEvent(experienceEvent: experienceEvent)
Copied to your clipboard// Example 2 - send the Experience Event and handle the Edge Network response onCompleteEdge.sendEvent(experienceEvent: experienceEvent) { (handles: [EdgeEventHandle]) in// Handle the Edge Network response}
Example with Datastream ID override
Copied to your clipboard// Create Experience event from dictionaryvar xdmData : [String: Any] = ["eventType" : "SampleXDMEvent","sample": "data"]let experienceEvent = ExperienceEvent(xdm: xdmData, datastreamIdOverride: "SampleDatastreamId")Edge.sendEvent(experienceEvent: experienceEvent) { (handles: [EdgeEventHandle]) in// Handle the Edge Network response}
Example with Datastream config override
Copied to your clipboard// Create Experience event from dictionaryvar xdmData : [String: Any] = ["eventType" : "SampleXDMEvent","sample": "data"]let configOverrides: [String: Any] = ["com_adobe_experience_platform": ["datasets": ["event": ["datasetId": "SampleEventDatasetIdOverride"]]],"com_adobe_analytics": ["reportSuites": ["rsid1","rsid2","rsid3"]],"com_adobe_identity": ["idSyncContainerId": "1234567"],"com_adobe_target": ["propertyToken": "SamplePropertyToken"]]let experienceEvent = ExperienceEvent(xdm: xdmData, datastreamConfigOverride: configOverrides)Edge.sendEvent(experienceEvent: experienceEvent) { (handles: [EdgeEventHandle]) in// Handle the Edge Network response}
Objective-C
Syntax
Copied to your clipboard+ (void) sendExperienceEvent:(AEPExperienceEvent * _Nonnull) completion:^(NSArray<AEPEdgeEventHandle *> * _Nonnull)completion
Example
Copied to your clipboard// Create Experience Event from dictionary:NSDictionary *xdmData = @{ @"eventType" : @"SampleXDMEvent"};NSDictionary *data = @{ @"sample" : @"data"};
Copied to your clipboard// Example 1 - send the Experience Event without handling the Edge Network response[AEPMobileEdge sendExperienceEvent:event completion:nil];
Copied to your clipboard// Example 2 - send the Experience Event and handle the Edge Network response onComplete[AEPMobileEdge sendExperienceEvent:event completion:^(NSArray<AEPEdgeEventHandle *> * _Nonnull handles) {// handle the Edge Network response}];
Example with Datastream ID override
Copied to your clipboard// Create Experience event from dictionary:NSDictionary *xdmData = @{ @"eventType" : @"SampleXDMEvent"};NSDictionary *data = @{ @"sample" : @"data"};AEPExperienceEvent* event = [[AEPExperienceEvent alloc]initWithXdm:xdmData data:data datastreamIdOverride: @"SampleDatastreamIdOverride"];[AEPMobileEdge sendExperienceEvent:event completion:^(NSArray<AEPEdgeEventHandle *> * _Nonnull handles) {// Handle the Edge Network response}];
Example with Datastream config override
Copied to your clipboard// Create Experience event from dictionary:NSDictionary *xdmData = @{ @"eventType" : @"SampleXDMEvent"};NSDictionary *data = @{ @"sample" : @"data"};NSDictionary *configOverrides = @{ @"com_adobe_experience_platform" : @{@"datasets" : @{@"event" : @{@"datasetId": @"SampleEventDatasetIdOverride"}}},@"com_adobe_analytics" : @{@"reportSuites" : @[@"rsid1",@"rsid2",@"rsid3",]},@"com_adobe_identity" : @{@"idSyncContainerId": @"1234567"},@"com_adobe_target" : @{@"propertyToken": @"SamplePropertyToken"}}AEPExperienceEvent* event = [[AEPExperienceEvent alloc]initWithXdm:xdmData data:data datastreamConfigOverride: configOverrides];[AEPMobileEdge sendExperienceEvent:event completion:^(NSArray<AEPEdgeEventHandle *> * _Nonnull handles) {// Handle the Edge Network response}];
setLocationHint
Sets the Edge Network location hint used in requests to the Adobe Experience Platform Edge Network. Passing nil or an empty string clears the existing location hint. Edge Network responses may overwrite the location hint to a new value when necessary to manage network traffic.
Use caution when setting the location hint. Only use location hints for the "EdgeNetwork" scope. An incorrect location hint value will cause all Edge Network requests to fail with 404 response code.
Java
Syntax
Copied to your clipboardpublic static void setLocationHint(final String hint)
- hint the Edge Network location hint to use when connecting to the Adobe Experience Platform Edge Network.
Example
Copied to your clipboardEdge.setLocationHint(hint);
Kotlin
Example
Copied to your clipboardEdge.setLocationHint(hint)
Swift
Syntax
Copied to your clipboard@objc(setLocationHint:)public static func setLocationHint(_ hint: String?)
- hint the Edge Network location hint to use when connecting to the Adobe Experience Platform Edge Network.
Example
Copied to your clipboardEdge.setLocationHint(hint)
Objective-C
Syntax
Copied to your clipboard+ (void) setLocationHint: (NSString * _Nullable hint);
Example
Copied to your clipboard[AEPMobileEdge setLocationHint:hint];
Java
Syntax
Copied to your clipboardpublic static void setLocationHint(final String hint)
- hint the Edge Network location hint to use when connecting to the Adobe Experience Platform Edge Network.
Example
Copied to your clipboardEdge.setLocationHint(hint);
Kotlin
Example
Copied to your clipboardEdge.setLocationHint(hint)
Swift
Syntax
Copied to your clipboard@objc(setLocationHint:)public static func setLocationHint(_ hint: String?)
- hint the Edge Network location hint to use when connecting to the Adobe Experience Platform Edge Network.
Example
Copied to your clipboardEdge.setLocationHint(hint)
Objective-C
Syntax
Copied to your clipboard+ (void) setLocationHint: (NSString * _Nullable hint);
Example
Copied to your clipboard[AEPMobileEdge setLocationHint:hint];
Public classes
XDM Schema
The AEP Edge extension provides the Schema and Property interfaces (Android) / XDMSchema protocol (iOS) that can be used to define the classes associated with your XDM schema in Adobe Experience Platform.
Java
Copied to your clipboard/*** The interface that represents an Experience XDM event data schema.*/public interface Schema {/*** Returns the version of this schema as defined in the Adobe Experience Platform.* @return the version of this schema.*/String getSchemaVersion();/*** Returns the identifier for this schema as defined in the Adobe Experience Platform.* The identifier is a URI where this schema is defined.* @return the URI identifier for this schema.*/String getSchemaIdentifier();/*** Returns the identifier for this dataset as defined in the Adobe Experience Platform.* @return the dataset ID*/String getDatasetIdentifier();/*** Serialize this {@code Schema} object to a map with the same format as its XDM schema.* @return the XDM-formatted map of this {@code Schema} object.*/Map<String, Object> serializeToXdm();}
By implementing the Property interface, you can define complex properties for your XDM Schema. A complex property is defined as not being a primitive type, String, or Date.
Copied to your clipboardpublic interface Property {/*** Serialize this {@code Property} object to a map with the same format as its XDM schema.* @return XDM-formatted map of this {@code Property} object.*/Map<String, Object> serializeToXdm();}
When defining your custom XDM schema(s), implement these interfaces to ensure that the AEP Edge extension successfully serializes the provided data before sending it to Adobe Experience Platform Edge Network.
Swift
Copied to your clipboard/// An interface representing a Platform XDM Event Data schema.public protocol XDMSchema: Encodable {/// Returns the version of this schema as defined in the Adobe Experience Platform./// - Returns: The version of this schemavar schemaVersion: String { get }/// Returns the identifier for this schema as defined in the Adobe Experience Platform./// The identifier is a URI where this schema is defined./// - Returns: The URI identifier for this schemavar schemaIdentifier: String { get }/// Returns the identifier for this dataset as defined in the Adobe Experience Platform./// This is a system generated identifier for the Dataset the event belongs to./// - Returns: The identifier as a String for this datasetvar datasetIdentifier: String { get }}
Java
Copied to your clipboard/*** The interface that represents an Experience XDM event data schema.*/public interface Schema {/*** Returns the version of this schema as defined in the Adobe Experience Platform.* @return the version of this schema.*/String getSchemaVersion();/*** Returns the identifier for this schema as defined in the Adobe Experience Platform.* The identifier is a URI where this schema is defined.* @return the URI identifier for this schema.*/String getSchemaIdentifier();/*** Returns the identifier for this dataset as defined in the Adobe Experience Platform.* @return the dataset ID*/String getDatasetIdentifier();/*** Serialize this {@code Schema} object to a map with the same format as its XDM schema.* @return the XDM-formatted map of this {@code Schema} object.*/Map<String, Object> serializeToXdm();}
By implementing the Property interface, you can define complex properties for your XDM Schema. A complex property is defined as not being a primitive type, String, or Date.
Copied to your clipboardpublic interface Property {/*** Serialize this {@code Property} object to a map with the same format as its XDM schema.* @return XDM-formatted map of this {@code Property} object.*/Map<String, Object> serializeToXdm();}
When defining your custom XDM schema(s), implement these interfaces to ensure that the AEP Edge extension successfully serializes the provided data before sending it to Adobe Experience Platform Edge Network.
Swift
Copied to your clipboard/// An interface representing a Platform XDM Event Data schema.public protocol XDMSchema: Encodable {/// Returns the version of this schema as defined in the Adobe Experience Platform./// - Returns: The version of this schemavar schemaVersion: String { get }/// Returns the identifier for this schema as defined in the Adobe Experience Platform./// The identifier is a URI where this schema is defined./// - Returns: The URI identifier for this schemavar schemaIdentifier: String { get }/// Returns the identifier for this dataset as defined in the Adobe Experience Platform./// This is a system generated identifier for the Dataset the event belongs to./// - Returns: The identifier as a String for this datasetvar datasetIdentifier: String { get }}
EdgeEventHandle
The EdgeEventHandle
is a response fragment from Adobe Experience Platform Edge Network for a sent XDM Experience Event.
One event can receive none, one or multiple EdgeEventHandle
(s) as response.
Java
Copied to your clipboard/*** The {@link EdgeEventHandle} is a response fragment from Adobe Experience Edge Service for a sent XDM Experience Event.* One event can receive none, one or multiple {@link EdgeEventHandle}(s) as response.*/public class EdgeEventHandle {/*** @return the payload type or null if not found in the {@link JSONObject} response*/public String getType() {...}/*** @return the event payload values for this {@link EdgeEventHandle} or null if not found in the {@link JSONObject} response*/public List<Map<String, Object>> getPayload() {...}}
Java
Copied to your clipboard/*** The {@link EdgeEventHandle} is a response fragment from Adobe Experience Edge Service for a sent XDM Experience Event.* One event can receive none, one or multiple {@link EdgeEventHandle}(s) as response.*/public class EdgeEventHandle {/*** @return the payload type or null if not found in the {@link JSONObject} response*/public String getType() {...}/*** @return the event payload values for this {@link EdgeEventHandle} or null if not found in the {@link JSONObject} response*/public List<Map<String, Object>> getPayload() {...}}
Use this class when calling the sendEvent API with EdgeCallback.
ExperienceEvent
Experience Event is the event to be sent to Adobe Experience Platform Edge Network. The XDM data is required for any Experience Event being sent using the Edge extension.
Java
Copied to your clipboardpublic final class ExperienceEvent {public static class Builder {...public Builder() {...}/*** Sets free form data associated with this event to be passed to Adobe Experience Edge.** @param data free form data, JSON like types are accepted* @return instance of current builder* @throws UnsupportedOperationException if this instance was already built*/public Builder setData(final Map<String, Object> data) {...}/*** Solution specific XDM event data for this event.** @param xdm {@link Schema} information* @return instance of current builder* @throws UnsupportedOperationException if this instance was already built*/public Builder setXdmSchema(final Schema xdm) {...}/*** Solution specific XDM event data and dataset identifier for this event.** @param xdm {@code Map<String, Object>} of raw XDM schema data* @param datasetIdentifier The Experience Platform dataset identifier where this event is sent.* If not provided, the default dataset defined in the configuration ID is used* @return instance of current builder* @throws UnsupportedOperationException if this instance was already built*/public Builder setXdmSchema(final Map<String, Object> xdm, final String datasetIdentifier) {...}/*** Solution specific XDM event data for this event, passed as raw mapping of keys and* Object values.** @param xdm {@code Map<String, Object>} of raw XDM schema data* @return instance of current builder* @throws UnsupportedOperationException if this instance was already built*/public Builder setXdmSchema(final Map<String, Object> xdm) {...}/*** Override the default datastream identifier to send this event's data to a different datastream.** When using {@link Edge#sendEvent}, this event is sent to the Experience Platform using the* datastream identifier {@code datastreamIdOverride} instead of the default Experience Edge* configuration ID set in the SDK Configuration key {@code edge.configId}.** @param datastreamIdOverride Datastream identifier to override the default datastream identifier set in the Edge configuration* @return instance of current builder* @throws UnsupportedOperationException if this instance was already built**/public Builder setDatastreamIdOverride(final String datastreamIdOverride) {...}/*** Override the default datastream configuration settings for individual services for this event.** When using {@link Edge#sendEvent}, this event is sent to the Experience Platform along with the* datastream overrides defined in {@code datastreamConfigOverride}.** @param datastreamConfigOverride Map defining datastream configuration overrides for this Experience Event* @return instance of current builder* @throws UnsupportedOperationException if this instance was already built*/public Builder setDatastreamConfigOverride(final Map<String, Object> datastreamConfigOverride) {...}/*** Builds and returns a new instance of {@code ExperienceEvent}.** @return a new instance of {@code ExperienceEvent} or null if one of the required parameters is missing* @throws UnsupportedOperationException if this instance was already built*/public ExperienceEvent build() {...}}public Map<String, Object> getData() {...}public Map<String, Object> getXdmSchema() {...}public String getDatastreamIdOverride() {...}public Map<String, Object> getDatastreamConfigOverride() {...}}
Examples
Copied to your clipboard// Example 1// Create Experience Event with both XDM and freeform data using mapsMap<String, Object> xdmData = new HashMap<>();xdmData.put("eventType", "SampleXDMEvent");xdmData.put("sample", "data");Map<String, Object> data = new HashMap<>();data.put("free", "form");data.put("data", "example");ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(xdmData).setData(data).build();
Copied to your clipboard// Example 2// Create Experience Event from XDM Schema implementationpublic class XDMSchemaExample implements com.adobe.marketing.mobile.xdm.Schema {private String eventType;private String otherField;...public String getEventType() {return this.eventType;}public void setEventType(final String newValue) {this.eventType = newValue;}public String getOtherField() {return this.otherField;}public void setOtherField(final String newValue) {this.otherField = newValue;}}// Create Experience Event from SchemaXDMSchemaExample xdmData = new XDMSchemaExample();xdmData.setEventType("SampleXDMEvent");xdmData.setOtherField("OtherFieldValue");ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(xdmData).build();
Copied to your clipboard// Example 3// Set the destination Dataset identifier to the current Experience EventMap<String, Object> xdmData = new HashMap<>();xdmData.put("eventType", "SampleXDMEvent");xdmData.put("sample", "data");ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(xdmData, "datasetIdExample").build();
Copied to your clipboard@objc(AEPExperienceEvent)public class ExperienceEvent: NSObject {/// XDM formatted data, use an `XDMSchema` implementation for a better XDM data injection and format control@objc public let xdm: [String: Any]?/// Optional free-form data associated with this event@objc public let data: [String: Any]?/// Datastream identifier used to override the default datastream identifier set in the Edge configuration for this event@objc public private(set) var datastreamIdOverride: String?/// Datastream configuration used to override individual settings from the default datastream configuration for this event@objc public private(set) var datastreamConfigOverride: [String: Any]?/// Adobe Experience Platform dataset identifier, if not set the default dataset identifier set in the Edge Configuration is used@objc public let datasetIdentifier: String?/// Initialize an Experience Event with the provided event data/// - Parameters:/// - xdm: XDM formatted data for this event, passed as a raw XDM Schema data dictionary./// - data: Any free form data in a [String : Any] dictionary structure.@objc public init(xdm: [String: Any], data: [String: Any]? = nil) {...}/// Initialize an Experience Event with the provided event data/// - Parameters:/// - xdm: XDM formatted data for this event, passed as a raw XDM Schema data dictionary./// - data: Any free form data in a [String : Any] dictionary structure./// - datasetIdentifier: The Experience Platform dataset identifier where this event should be sent to; if not provided, the default dataset identifier set in the Edge configuration is used@objc public convenience init(xdm: [String: Any], data: [String: Any]? = nil, datasetIdentifier: String? = nil) {...}/// Initialize an Experience Event with the provided event data/// - Parameters:/// - xdm: XDM formatted data for this event, passed as a raw XDM Schema data dictionary./// - data: Any free form data in a [String : Any] dictionary structure./// - datastreamIdOverride: Datastream identifier used to override the default datastream identifier set in the Edge configuration for this event./// - datastreamConfigOverride: Datastream configuration used to override individual settings from the default datastream configuration for this event.@objc public convenience init(xdm: [String: Any], data: [String: Any]? = nil, datastreamIdOverride: String? = nil, datastreamConfigOverride: [String: Any]? = nil) {...}/// Initialize an Experience Event with the provided event data/// - Parameters:/// - xdm: XDM formatted event data passed as an XDMSchema/// - data: Any free form data in a [String : Any] dictionary structure.public init(xdm: XDMSchema, data: [String: Any]? = nil) {...}/// Initialize an Experience Event with the provided event data/// - Parameters:/// - xdm: XDM formatted event data passed as an XDMSchema/// - data: Any free form data in a [String : Any] dictionary structure./// - datastreamIdOverride: Datastream identifier used to override the default datastream identifier set in the Edge configuration for this event./// - datastreamConfigOverride: Datastream configuration used to override individual settings from the default datastream configuration for this event.public convenience init(xdm: XDMSchema, data: [String: Any]? = nil, datastreamIdOverride: String? = nil, datastreamConfigOverride: [String: Any]? = nil) {...}}
Swift
Examples
Copied to your clipboard// Example 1// Create Experience Event with both XDM and freeform data using dictionariesvar xdmData : [String: Any] = ["eventType" : "SampleXDMEvent","sample": "data"]let experienceEvent = ExperienceEvent(xdm: xdmData, data: ["free": "form", "data": "example"])
Copied to your clipboard// Example 2// Create Experience Event from XDM Schema implementationimport AEPEdgepublic struct XDMSchemaExample : XDMSchema {public let schemaVersion = "1.0" // Returns the version of this schema as defined in the Adobe Experience Platform.public let schemaIdentifier = "" // The URI identifier for this schemapublic let datasetIdentifier = "" // The identifier for the Dataset this event belongs to.public init() {}public var eventType: String?public var otherField: String?enum CodingKeys: String, CodingKey {case eventType = "eventType"case otherField = "otherField"}}extension XDMSchemaExample {public func encode(to encoder: Encoder) throws {var container = encoder.container(keyedBy: CodingKeys.self)if let unwrapped = eventType { try container.encode(unwrapped, forKey: .eventType) }if let unwrapped = otherField { try container.encode(unwrapped, forKey: .otherField) }}}...// Create Experience Event from XDMSchemavar xdmData = XDMSchemaExample()xdmData.eventType = "SampleXDMEvent"xdm.otherField = "OtherFieldValue"let event = ExperienceEvent(xdm: xdmData)
Copied to your clipboard// Example 3// Set the destination Dataset identifier to the current Experience Eventvar xdmData : [String: Any] = ["eventType" : "SampleXDMEvent","sample": "data"]let experienceEvent = ExperienceEvent(xdm: xdmData, datasetIdentifier: "datasetIdExample")
Objective-C
Examples
Copied to your clipboard// Example 1// Create Experience Event with both XDM and freeform data using dictionariesNSDictionary *xdmData = @{ @"eventType" : @"SampleXDMEvent"};NSDictionary *data = @{ @"sample" : @"data"};AEPExperienceEvent* event = [[AEPExperienceEvent alloc]initWithXdm:xdmData data:data];
Copied to your clipboard// Example 2// Set the destination Dataset identifier to the current Experience EventNSDictionary *xdmData = @{ @"eventType" : @"SampleXDMEvent"};AEPExperienceEvent *event = [[AEPExperienceEvent alloc] initWithXdm:xdmData data:nil datasetIdentifier:@"datasetIdExample"];
Java
Copied to your clipboardpublic final class ExperienceEvent {public static class Builder {...public Builder() {...}/*** Sets free form data associated with this event to be passed to Adobe Experience Edge.** @param data free form data, JSON like types are accepted* @return instance of current builder* @throws UnsupportedOperationException if this instance was already built*/public Builder setData(final Map<String, Object> data) {...}/*** Solution specific XDM event data for this event.** @param xdm {@link Schema} information* @return instance of current builder* @throws UnsupportedOperationException if this instance was already built*/public Builder setXdmSchema(final Schema xdm) {...}/*** Solution specific XDM event data and dataset identifier for this event.** @param xdm {@code Map<String, Object>} of raw XDM schema data* @param datasetIdentifier The Experience Platform dataset identifier where this event is sent.* If not provided, the default dataset defined in the configuration ID is used* @return instance of current builder* @throws UnsupportedOperationException if this instance was already built*/public Builder setXdmSchema(final Map<String, Object> xdm, final String datasetIdentifier) {...}/*** Solution specific XDM event data for this event, passed as raw mapping of keys and* Object values.** @param xdm {@code Map<String, Object>} of raw XDM schema data* @return instance of current builder* @throws UnsupportedOperationException if this instance was already built*/public Builder setXdmSchema(final Map<String, Object> xdm) {...}/*** Override the default datastream identifier to send this event's data to a different datastream.** When using {@link Edge#sendEvent}, this event is sent to the Experience Platform using the* datastream identifier {@code datastreamIdOverride} instead of the default Experience Edge* configuration ID set in the SDK Configuration key {@code edge.configId}.** @param datastreamIdOverride Datastream identifier to override the default datastream identifier set in the Edge configuration* @return instance of current builder* @throws UnsupportedOperationException if this instance was already built**/public Builder setDatastreamIdOverride(final String datastreamIdOverride) {...}/*** Override the default datastream configuration settings for individual services for this event.** When using {@link Edge#sendEvent}, this event is sent to the Experience Platform along with the* datastream overrides defined in {@code datastreamConfigOverride}.** @param datastreamConfigOverride Map defining datastream configuration overrides for this Experience Event* @return instance of current builder* @throws UnsupportedOperationException if this instance was already built*/public Builder setDatastreamConfigOverride(final Map<String, Object> datastreamConfigOverride) {...}/*** Builds and returns a new instance of {@code ExperienceEvent}.** @return a new instance of {@code ExperienceEvent} or null if one of the required parameters is missing* @throws UnsupportedOperationException if this instance was already built*/public ExperienceEvent build() {...}}public Map<String, Object> getData() {...}public Map<String, Object> getXdmSchema() {...}public String getDatastreamIdOverride() {...}public Map<String, Object> getDatastreamConfigOverride() {...}}
Examples
Copied to your clipboard// Example 1// Create Experience Event with both XDM and freeform data using mapsMap<String, Object> xdmData = new HashMap<>();xdmData.put("eventType", "SampleXDMEvent");xdmData.put("sample", "data");Map<String, Object> data = new HashMap<>();data.put("free", "form");data.put("data", "example");ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(xdmData).setData(data).build();
Copied to your clipboard// Example 2// Create Experience Event from XDM Schema implementationpublic class XDMSchemaExample implements com.adobe.marketing.mobile.xdm.Schema {private String eventType;private String otherField;...public String getEventType() {return this.eventType;}public void setEventType(final String newValue) {this.eventType = newValue;}public String getOtherField() {return this.otherField;}public void setOtherField(final String newValue) {this.otherField = newValue;}}// Create Experience Event from SchemaXDMSchemaExample xdmData = new XDMSchemaExample();xdmData.setEventType("SampleXDMEvent");xdmData.setOtherField("OtherFieldValue");ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(xdmData).build();
Copied to your clipboard// Example 3// Set the destination Dataset identifier to the current Experience EventMap<String, Object> xdmData = new HashMap<>();xdmData.put("eventType", "SampleXDMEvent");xdmData.put("sample", "data");ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(xdmData, "datasetIdExample").build();
Copied to your clipboard@objc(AEPExperienceEvent)public class ExperienceEvent: NSObject {/// XDM formatted data, use an `XDMSchema` implementation for a better XDM data injection and format control@objc public let xdm: [String: Any]?/// Optional free-form data associated with this event@objc public let data: [String: Any]?/// Datastream identifier used to override the default datastream identifier set in the Edge configuration for this event@objc public private(set) var datastreamIdOverride: String?/// Datastream configuration used to override individual settings from the default datastream configuration for this event@objc public private(set) var datastreamConfigOverride: [String: Any]?/// Adobe Experience Platform dataset identifier, if not set the default dataset identifier set in the Edge Configuration is used@objc public let datasetIdentifier: String?/// Initialize an Experience Event with the provided event data/// - Parameters:/// - xdm: XDM formatted data for this event, passed as a raw XDM Schema data dictionary./// - data: Any free form data in a [String : Any] dictionary structure.@objc public init(xdm: [String: Any], data: [String: Any]? = nil) {...}/// Initialize an Experience Event with the provided event data/// - Parameters:/// - xdm: XDM formatted data for this event, passed as a raw XDM Schema data dictionary./// - data: Any free form data in a [String : Any] dictionary structure./// - datasetIdentifier: The Experience Platform dataset identifier where this event should be sent to; if not provided, the default dataset identifier set in the Edge configuration is used@objc public convenience init(xdm: [String: Any], data: [String: Any]? = nil, datasetIdentifier: String? = nil) {...}/// Initialize an Experience Event with the provided event data/// - Parameters:/// - xdm: XDM formatted data for this event, passed as a raw XDM Schema data dictionary./// - data: Any free form data in a [String : Any] dictionary structure./// - datastreamIdOverride: Datastream identifier used to override the default datastream identifier set in the Edge configuration for this event./// - datastreamConfigOverride: Datastream configuration used to override individual settings from the default datastream configuration for this event.@objc public convenience init(xdm: [String: Any], data: [String: Any]? = nil, datastreamIdOverride: String? = nil, datastreamConfigOverride: [String: Any]? = nil) {...}/// Initialize an Experience Event with the provided event data/// - Parameters:/// - xdm: XDM formatted event data passed as an XDMSchema/// - data: Any free form data in a [String : Any] dictionary structure.public init(xdm: XDMSchema, data: [String: Any]? = nil) {...}/// Initialize an Experience Event with the provided event data/// - Parameters:/// - xdm: XDM formatted event data passed as an XDMSchema/// - data: Any free form data in a [String : Any] dictionary structure./// - datastreamIdOverride: Datastream identifier used to override the default datastream identifier set in the Edge configuration for this event./// - datastreamConfigOverride: Datastream configuration used to override individual settings from the default datastream configuration for this event.public convenience init(xdm: XDMSchema, data: [String: Any]? = nil, datastreamIdOverride: String? = nil, datastreamConfigOverride: [String: Any]? = nil) {...}}
Swift
Examples
Copied to your clipboard// Example 1// Create Experience Event with both XDM and freeform data using dictionariesvar xdmData : [String: Any] = ["eventType" : "SampleXDMEvent","sample": "data"]let experienceEvent = ExperienceEvent(xdm: xdmData, data: ["free": "form", "data": "example"])
Copied to your clipboard// Example 2// Create Experience Event from XDM Schema implementationimport AEPEdgepublic struct XDMSchemaExample : XDMSchema {public let schemaVersion = "1.0" // Returns the version of this schema as defined in the Adobe Experience Platform.public let schemaIdentifier = "" // The URI identifier for this schemapublic let datasetIdentifier = "" // The identifier for the Dataset this event belongs to.public init() {}public var eventType: String?public var otherField: String?enum CodingKeys: String, CodingKey {case eventType = "eventType"case otherField = "otherField"}}extension XDMSchemaExample {public func encode(to encoder: Encoder) throws {var container = encoder.container(keyedBy: CodingKeys.self)if let unwrapped = eventType { try container.encode(unwrapped, forKey: .eventType) }if let unwrapped = otherField { try container.encode(unwrapped, forKey: .otherField) }}}...// Create Experience Event from XDMSchemavar xdmData = XDMSchemaExample()xdmData.eventType = "SampleXDMEvent"xdm.otherField = "OtherFieldValue"let event = ExperienceEvent(xdm: xdmData)
Copied to your clipboard// Example 3// Set the destination Dataset identifier to the current Experience Eventvar xdmData : [String: Any] = ["eventType" : "SampleXDMEvent","sample": "data"]let experienceEvent = ExperienceEvent(xdm: xdmData, datasetIdentifier: "datasetIdExample")
Objective-C
Examples
Copied to your clipboard// Example 1// Create Experience Event with both XDM and freeform data using dictionariesNSDictionary *xdmData = @{ @"eventType" : @"SampleXDMEvent"};NSDictionary *data = @{ @"sample" : @"data"};AEPExperienceEvent* event = [[AEPExperienceEvent alloc]initWithXdm:xdmData data:data];
Copied to your clipboard// Example 2// Set the destination Dataset identifier to the current Experience EventNSDictionary *xdmData = @{ @"eventType" : @"SampleXDMEvent"};AEPExperienceEvent *event = [[AEPExperienceEvent alloc] initWithXdm:xdmData data:nil datasetIdentifier:@"datasetIdExample"];
See Edge Extension Usage for more examples.