Returns the version of the client-side Edge extension.
{% tabs %} {% tab title="Android" %}
public static String extensionVersion();
Edge.extensionVersion();
{% endtab %}
{% tab title="iOS" %}
public static let extensionVersion
Edge.extensionVersion
// Swift Edge
public static let extensionVersion
[AEPMobileEdge extensionVersion];
{% endtab %} {% endtabs %}
Sends an Experience event to Adobe Experience Edge Network.
{% tabs %} {% tab title="Android" %}
public static void sendEvent(final ExperienceEvent experienceEvent, final EdgeCallback callback);
- experienceEvent - the XDM Experience Event to be sent to Adobe Experience Edge Network
- callback - optional callback to be invoked when the request is complete, returning the associated response handles received from the Adobe Experience Edge Network. It may be invoked on a different thread.
// example 1 - send the experience event without handling the Edge Network response
Edge.sendEvent(experienceEvent, null);
// example 2 - send the experience event and handle the Edge Network response onComplete
Edge.sendEvent(experienceEvent, new EdgeCallback() {
@Override
public void onComplete(final List<EdgeEventHandle> handles) {
// handle the Edge Network response
}
});
{% endtab %}
{% tab title="iOS" %}
static func sendEvent(experienceEvent: ExperienceEvent, _ completion: (([EdgeEventHandle]) -> Void)? = nil)
- experienceEvent - the XDM Experience Event to be sent to Adobe Experience Edge Network
- completion - optional completion handler to be invoked when the request is complete, returning the associated response handles received from the Adobe Experience Edge Network. It may be invoked on a different thread.
// example 1 - send the experience event without handling the Edge Network response
Edge.sendEvent(experienceEvent: experienceEvent)
// example 2 - send the experience event and handle the Edge Network response onComplete
Edge.sendEvent(experienceEvent: experienceEvent) { (handles: [EdgeEventHandle]) in
// handle the Edge Network response
}
// Swift Edge
static func sendEvent(experienceEvent: ExperienceEvent, _ completion: (([EdgeEventHandle]) -> Void)? = nil)
// example 1 - send the experience event without handling the Edge Network response
[AEPMobileEdge sendExperienceEvent:event completion:nil];
// 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
}];
{% endtab %} {% endtabs %}
Registers the Edge extension with the Mobile Core SDK.
{% tabs %} {% tab title="Android" %}
public static void registerExtension();
Edge.registerExtension();
{% endtab %}
{% tab title="iOS" %}
Use the MobileCore API to register the Edge extension.
// MobileCore
public static func registerExtensions(_ extensions: [Extension.Type], _ completion: (() -> Void)? = nil)
MobileCore.registerExtensions([Edge.self, ...], {
// processing after registration
})
Use the AEPMobileCore API to register the Edge extension.
// Swift MobileCore
public static func registerExtensions(_ extensions: [Extension.Type], _ completion: (() -> Void)? = nil)
[AEPMobileCore registerExtensions:@[AEPMobileEdge.class, ...] completion:^{
// processing after registration
}];
{% endtab %} {% endtabs %}
{% tabs %} {% tab title="Android" %}
The Edge extension provides the following interfaces:
- Schema
- Property
By using the Edge extension, the Schema interface can be used to define the classes that are associated with your defined schema in Adobe Experience Platform.
/**
* 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.
public 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 Edge Network.
/**
* 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. {% endtab %} {% endtabs %}