This document is a reference comparison of AEPAnalytics (3.x) APIs against their equivalent ACPAnalytics (2.x) APIs.
The AEPAnalytics extension is implemented purely in Swift and is compatible with the AEPCore Swift SDK. To ensure a smooth transition from the ACPAnalytics SDK, there are no major changes on the API names or definition. For more details, follow the migration guide below for your Swift or Objective-C mobile application. If explanation beyond showing API differences is necessary, it will be captured as an info hint within that API's section.
Type | AEP 3.x (Swift) | AEP 3.x (Objective-C) | ACP 2.x (Objective-C) |
---|---|---|---|
Primary Class | Analytics | AEPMobileAnalytics | ACPAnalytics |
{% tabs %} {% tab title="AEP 3.x (Swift)" %}
static func clearQueue()
{% endtab %}
{% tab title="AEP 3.x (Objective-C)" %}
+ (void) clearQueue;
{% endtab %}
{% tab title="ACP 2.x (Objective-C)" %}
+ (void) clearQueue;
{% endtab %} {% endtabs %}
{% tabs %} {% tab title="AEP 3.x (Swift)" %}
static var extensionVersion: String
{% endtab %}
{% tab title="AEP 3.x (Objective-C)" %}
+ (nonnull NSString*) extensionVersion;
{% endtab %}
{% tab title="ACP 2.x (Objective-C)" %}
+ (nonnull NSString*) extensionVersion;
{% endtab %} {% endtabs %}
{% tabs %} {% tab title="AEP 3.x (Swift)" %}
static func getQueueSize(completion: @escaping (Int, Error?) -> Void)
{% endtab %}
{% tab title="AEP 3.x (Objective-C)" %}
+ (void) getQueueSize:^(NSInteger queueSize, NSError * _Nullable error)completion;
{% endtab %}
{% tab title="ACP 2.x (Objective-C)" %}
+ (void) getQueueSize: (nonnull void (^) (NSUInteger queueSize)) callback;
+ (void) getQueueSizeWithCompletionHandler: (nonnull void (^) (NSUInteger queueSize, NSError* __nullable error)) completionHandler;
{% endtab %} {% endtabs %}
{% tabs %} {% tab title="AEP 3.x (Swift)" %}
static func getTrackingIdentifier(completion: @escaping (String?, Error?) -> Void)
{% endtab %}
{% tab title="AEP 3.x (Objective-C)" %}
+ (void) getTrackingIdentifier:^(NSString * _Nullable trackingIdentifier, NSError * _Nullable error)completion;
{% endtab %}
{% tab title="ACP 2.x (Objective-C)" %}
+ (void) getTrackingIdentifier: (nonnull void (^) (NSString* __nullable trackingIdentifier)) callback;
+ (void) getTrackingIdentifierWithCompletionHandler: (nonnull void (^) (NSString* __nullable trackingIdentifier, NSError* __nullable error)) completionHandler;
{% endtab %} {% endtabs %}
{% tabs %} {% tab title="AEP 3.x (Swift)" %}
static func getVisitorIdentifier(completion: @escaping (String?, Error?) -> Void)
{% endtab %}
{% tab title="AEP 3.x (Objective-C)" %}
+ (void) getVisitorIdentifier:^(NSString * _Nullable visitorIdentifier, NSError * _Nullable error)completion;
{% endtab %}
{% tab title="ACP 2.x (Objective-C)" %}
+ (void) getVisitorIdentifier: (nonnull void (^) (NSString* __nullable visitorIdentifier)) callback;
+ (void) getVisitorIdentifierWithCompletionHandler: (nonnull void (^) (NSString* __nullable visitorIdentifier, NSError* __nullable error)) completionHandler;
{% endtab %} {% endtabs %}
{% tabs %} {% tab title="AEP 3.x (Swift)" %}
static func sendQueuedHits()
{% endtab %}
{% tab title="AEP 3.x (Objective-C)" %}
+ (void) sendQueuedHits;
{% endtab %}
{% tab title="ACP 2.x (Objective-C)" %}
+ (void) sendQueuedHits;
{% endtab %} {% endtabs %}
{% tabs %} {% tab title="AEP 3.x (Swift)" %}
static func setVisitorIdentifier(visitorIdentifier: String)
{% endtab %}
{% tab title="AEP 3.x (Objective-C)" %}
+ (void) setVisitorIdentifier:(NSString * _Nonnull) visitorIdentifier;
{% endtab %}
{% tab title="ACP 2.x (Objective-C)" %}
+ (void) setVisitorIdentifier: (nonnull NSString*) visitorIdentifier;
{% endtab %} {% endtabs %}