ACPCore
on iOS and MobileCore
on Android provide some APIs that generate events that are dispatched to the Adobe Core eventhub. These APIs provide a standard way to perform the corresponding actions by usng an extension that supports these actions.
By default, the APIs listed here will only generate events. To perform the corresponding action, you need to include and register an extension that supports these events/actions.
The APIs for the corresponding platforms dispatch an event that notifies the Adobe SDK, and any extensions, that you might have enabled a track action, which is being requested. If an extension supports this event, the functionality will be carried out.
public static void trackAction(final String action, final Map<String, String> contextData)
Map<String, String> additionalContextData = new HashMap<String, String>();
additionalContextData.put("customKey", "value");
MobileCore.trackAction("loginClicked", additionalContextData);
Ensure that the Analytics extension and the Identity extension are registered before this API is called:
Identity.registerExtension();
Analytics.registerExtension();
The Analytics extension supports this API.
+ (void) trackAction: (nullable NSString*) action data: (nullable NSDictionary*) data;
Here are examples in Objective-C and Swift:
Objective-C
[ACPCore trackAction:@"action name" data:@{@"key":@"value"}];
Swift
ACPCore.trackAction("action name", data: ["key": "value"])
Ensure that the Analytics extension and the Identity extension are registered before this API is called:
[ACPIdentity registerExtension];
[ACPAnalytics registerExtension];
The Analytics extension supports this API.
The APIs for the corresponding platforms dispatch an event that notifies the Adobe SDK, and any extensions, that you might have enabled a track state, which is now being requested. If an extension supports this event, the functionality will be carried out.
public static void trackState(final String state, final Map<String, String> contextData)
Map<String, String> additionalContextData = new HashMap<String, String>();
additionalContextData.put("customKey", "value");
MobileCore.trackState("homePage", additionalContextData);
Ensure that the Analytics extension and the Identity extension are registered before this API is called:
Identity.registerExtension();
Analytics.registerExtension();
The Analytics extension supports this API.
+ (void) trackState: (nullable NSString*) state data: (nullable NSDictionary*) data;
Here are examples in Objective-C and Swift:
Objective-C
[ACPCore trackState:@"state name" data:@{@"key":@"value"}];
Swift
ACPCore.trackState("state name", data: ["key": "value"])
Ensure that the Analytics extension and the Identity extension are registered before this API is called:
[ACPIdentity registerExtension];
[ACPAnalytics registerExtension];
The Analytics extension supports this API.
The APIs for the corresponding platforms dispatch an event that notifies the Adobe SDK, and any extensions, that you might have enabled a collect PII action to be requested. If an extension supports this event, the functionality will be carried out.
public static void collectPii(final Map<String, String> data);
Map<String, String> data = new HashMap<String, String>();
data.put("firstname", "customer");
//The rule to trigger a PII needs to be setup for this call
//to result in a network send
MobileCore.collectPii(data);
Ensure that the Signal
extension is registered before this API is called:
Signal.registerExtension();
The Signal extension supports this API.
+ (void) collectPii: (nonnull NSDictionary<NSString*, NSString*>*) data;
Here are examples in Objective-C and Swift:
Objective-C
[ACPCore collectPii:@{@"firstname":@"customer"};
Swift
let data: NSDictionary = ["firstname": "customer"]
//The rule to trigger a PII needs to be setup for this call
//to result in a network send
ACPCore.collectPii(data as! [String : String])
Ensure that the ACPSignal
extension is registered before this API is called:
[ACPSignal registerExtension];
The Signal extension supports this API.
The APIs for the corresponding platforms dispatch an event that notifies the Adobe SDK and any extensions that you might have enabled that a application lifecycle start action is being performed. If an extension supports this event, the functionality will be carried out.
public static void lifecycleStart(final Map<String, String> additionalContextData)
Map<String, String> additionalContextData = new HashMap<String, String>();
additionalContextData.put("myapp.type", "example");
MobileCore.lifecycleStart(additionalContextData);
Ensure that the Lifecycle extension is registered before this API is called:
Lifecycle.registerExtension();
The Lifecycle
extension supports this API.
+ (void) lifecycleStart: (nullable NSDictionary<NSString*, NSString*>*) additionalContextData;
Here are examples in Objective-C and Swift:
Objective-C
NSDictionary* additionalContextData = @{@"myapp.type":@"example"};
[ACPCore lifecycleStart:additionalContextData];
Swift
var additionalContextData = [String: String]()
additionalContextData["myapp.type"] = "example"
ACPCore.lifecycleStart(additionalContextData)
Ensure that the Lifecycle extension is registered before this API is called:
[ACPLifecycle registerExtension];
The Lifecycle extension supports this API.
The APIs for the corresponding platforms dispatch an event that notifies the Adobe SDK, and any extensions, that you might have enabled a application lifecycle pause action is to be performed. If an extension supports this event, the functionality will be carried out.
public static void lifecyclePause()
MobileCore.lifecyclePause();
Ensure that the Lifecycle extension is registered before this API is called:
Lifecycle.registerExtension();
The Lifecycle extension supports this API.
+ (void) lifecyclePause;
Here are examples in Objective-C and Swift:
Objective-C
[ACPCore lifecyclePause];
Swift
ACPCore.lifecyclePause()
Ensure that the Lifecycle extension is registered before this API is called:
[ACPLifecycle registerExtension];
The Lifecycle extension supports this API.
The APIs for the corresponding platforms dispatch an event that notifies the Adobe SDK, and any extensions, that you might have enabled a platform advertising identifier to be available. If an extension supports this event, the the identitifer will be used according to the extension.
public static void setAdvertisingIdentifier(final String advertisingIdentifier);
MobileCore.setAdvertisingIdentifier("advertising_identifier");
Ensure that the Identity extension is registered before this API is called:
Identity.registerExtension();
The Identity extension supports this API.
+ (void) setAdvertisingIdentifier: (nullable NSString*) adId;
Here are examples in Objective-C and Swift:
Objective-C
[ACPCore setAdvertisingIdentifier:@"AdvertisingId"];
Swift
ACPCore.setAdvertisingIdentifier("AdvertisingId")
Ensure that the Identity
extension is registered before this API is called:
[ACPIdentity registerExtension];
The Identity extension supports this API.
The APIs for the corresponding platforms dispatch an event that notifies the Adobe SDK and any extensions that you might have enabled that a platform push identifier is available. If an extension supports this event then, the the identitifer will be used as per the extension.
public static void setPushIdentifier(final String pushIdentifier);
//Retrieve the token from either GCM or FCM, and pass it to the SDK
MobileCore.setPushIdentifier(token);
The Identity
extension supports this API. Ensure that the Identity
and Analytics
extensions are registered before this API is called:
Identity.registerExtension();
Analytics.registerExtension();
+ (void) setPushIdentifier: (nullable NSData*) deviceToken;
Here are examples in Objective-C and Swift:
Objective-C
// Set the deviceToken that the APNS has assigned to the device
[ACPCore setPushIdentifier:deviceToken];
Swift
// Set the deviceToken that the APNs has assigned to the device
ACPCore.setPushIdentifier(deviceToken)
Ensure that the Identity
and Analytics
extensions are registered before this API is called:
[ACPIdentity registerExtension];
[ACPAnalytics registerExtension];
The Identity extension supports this API.