Migrating to AEPTarget reference

This document is a reference comparison of AEPTarget(3.x) APIs against their equivalent ACPTarget (2.x) APIs for an iOS mobile application implementation.

The AEPTarget extension is implemented purely in Swift and is compatible with the AEPCore swift SDK. To ensure a smooth transition from the ACPTarget 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.

Public classes

Type

AEP 3.x (Swift)

AEP 3.x (Objective-C)

ACP 2.x (Objective-C)

Primary Class (Module)

Target

AEPMobileTarget

ACPTarget

Class

TargetRequest

AEPTargetRequestObject

ACPTargetRequestObject

Class

TargetPrefetch

AEPTargetPrefetchObject

ACPTargetPrefetchObject

Class

TargetOrder

AEPTargetOrder

ACPTargetOrder

Class

TargetParameters

AEPTargetParameters

ACPTargetParameters

Class

TargetProduct

AEPTargetProduct

ACPTargetProduct

Public APIs

clearPrefetchCache

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func clearPrefetchCache()
AEP 3.x (Objective-C)
+ (void) clearPrefetchCache;
ACP 2.x (Objective-C)
+ (void) clearPrefetchCache;

clickedLocation

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func clickedLocation(_ name: String, targetParameters: TargetParameters? = nil)
AEP 3.x (Objective-C)
+ (void) clickedLocation: (NSString* _NonNull) name
withTargetParameters: (AEPTargetParameters* _Nullable) targetParameters;
ACP 2.x (Objective-C)
+ (void) locationClickedWithName: (nonnull NSString*) name
targetParameters: (nullable ACPTargetParameters*) parameters;

extensionVersion

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static var extensionVersion: String
AEP 3.x (Objective-C)
+ (nonnull NSString*) extensionVersion;
ACP 2.x (Objective-C)
+ (nonnull NSString*) extensionVersion;

getThirdPartyId

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func getThirdPartyId(_ completion: @escaping (String?, Error?) -> Void)
AEP 3.x (Objective-C)
+ (void) getThirdPartyId: (nonnull void (^) (NSString* _Nullable thirdPartyId, NSError* _Nullable error)) completion;
ACP 2.x (Objective-C)
+ (void) getThirdPartyId: (nonnull void (^) (NSString* __nullable thirdPartyId)) callback;

getTntId

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func getTntId(_ completion: @escaping (String?, Error?) -> Void)
AEP 3.x (Objective-C)
+ (void) getTntId: (nonnull void (^) (NSString* _Nullable tntId, NSError* _Nullable error)) completion;
ACP 2.x (Objective-C)
+ (void) getTntId: (nonnull void (^) (NSString* __nullable tntId)) callback;

prefetchContent

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func prefetchContent(_ prefetchArray: [TargetPrefetch], with targetParameters: TargetParameters? = nil, _ completion: ((Error?) -> Void)?)
AEP 3.x (Objective-C)
+ (void) prefetchContent: (NSArray<AEPTargetPrefetchObject*>* _NonNull) prefetchArray
withParameters: (AEPTargetParameters* _Nullable) targetParameters
callback: (nullable void (^) (NSError* _Nullable error)) completion;
ACP 2.x (Objective-C)
+ (void) prefetchContent: (nonnull NSArray<ACPTargetPrefetchObject*>*) prefetchObjectArray
withParameters: (nullable ACPTargetParameters*) parameters
callback: (nullable void (^) (NSError* _Nullable error)) callback;

registerExtension

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)

Registration occurs by passing Target to the MobileCore.registerExtensions API.

MobileCore.registerExtensions([Target.self])
AEP 3.x (Objective-C)

Registration occurs by passing AEPMobileTarget to the [AEPMobileCore registerExtensions:completion:] API.

[AEPMobileCore registerExtensions:@[AEPMobileTarget.class] completion:nil];
ACP 2.x (Objective-C)
[ACPTarget registerExtension];

retrieveLocationContent

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func retrieveLocationContent(_ requestArray: [TargetRequest], with targetParameters: TargetParameters? = nil)
AEP 3.x (Objective-C)
(void) retrieveLocationContent: (NSArray<AEPTargetRequestObject*>* _NonNull) requestsArray
withParameters: (AEPTargetParameters* _Nullable) targetParameters;
ACP 2.x (Objective-C)
+ (void) retrieveLocationContent: (nonnull NSArray<ACPTargetRequestObject*>*) requests
withParameters: (nullable ACPTargetParameters*) parameters;
AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func setPreviewRestartDeepLink(_ deeplink: URL)
AEP 3.x (Objective-C)
+ (void) setPreviewRestartDeeplink: (NSURL* _NonNull) deeplink;
ACP 2.x (Objective-C)
+ (void) setPreviewRestartDeeplink: (nonnull NSURL*) deeplink;

setThirdPartyId

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func setThirdPartyId(_ id: String?)
AEP 3.x (Objective-C)
+ (void) setThirdPartyId: (NSString* _Nullable) thirdPartyId;
ACP 2.x (Objective-C)
+ (void) setThirdPartyId: (nullable NSString*) thirdPartyId;