Migrating to AEPPlaces reference

This document is a reference comparison of AEPPlaces (3.x) APIs agains against their equivalent ACPPlaces (2.x) APIs.

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

Places

AEPMobilePlaces

ACPPlaces

Enum

PlacesQueryResponseCode

AEPPlacesQueryResponseCode

ACPPlacesRequestError

Class

PointOfInterest

AEPPlacesPoi

ACPPlacesPoi

Enum

PlacesRegionEvent

AEPPlacesRegionEvent

ACPRegionEventType

Public APIs (alphabetical)

clear

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

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;

getCurrentPointsOfInterest

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func getCurrentPointsOfInterest(_ closure: @escaping ([PointOfInterest]) -> Void)
AEP 3.x (Objective-C)
+ (void) getCurrentPointsOfInterest: ^(NSArray<AEPPlacesPoi*>* _Nonnull pois) closure;
ACP 2.x (Objective-C)
+ (void) getCurrentPointsOfInterest: (nullable void (^) (NSArray<ACPPlacesPoi*>* _Nullable userWithinPoi)) callback;

getLastKnownLocation

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

If the SDK has no last known location, it will pass nil to the closure.

static func getLastKnownLocation(_ closure: @escaping (CLLocation?) -> Void)
AEP 3.x (Objective-C)
+ (void) getLastKnownLocation: ^(CLLocation* _Nullable lastLocation) closure;
ACP 2.x (Objective-C)

If the SDK has no last known location, it will pass a CLLocation object with a value of 999.999 for latitude and longitude to the callback.

+ (void) getLastKnownLocation: (nullable void (^) (CLLocation* _Nullable lastLocation)) callback;

getNearbyPointsOfInterest

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

Rather than providing an overloaded method, a single method supports retrieval of nearby Points of Interest. The provided closure accepts two parameters, representing the resulting nearby points of interest (if any) and the response code.

static func getNearbyPointsOfInterest(forLocation location: CLLocation,
withLimit limit: UInt,
closure: @escaping ([PointOfInterest], PlacesQueryResponseCode) -> Void)
AEP 3.x (Objective-C)
+ (void) getNearbyPointsOfInterest: (nonnull CLLocation*) currentLocation
limit: (NSUInteger) limit
callback: ^ (NSArray<AEPPlacesPoi*>* _Nonnull, AEPPlacesQueryResponseCode) closure;
ACP 2.x (Objective-C)

Two getNearbyPointsOfInterest methods exist. The overloaded version allows the caller to provide an errorCallback parameter in the case of failure.

// without error handling
+ (void) getNearbyPointsOfInterest: (nonnull CLLocation*) currentLocation
limit: (NSUInteger) limit
callback: (nullable void (^) (NSArray<ACPPlacesPoi*>* _Nullable nearbyPoi)) callback;
// with error handling
+ (void) getNearbyPointsOfInterest: (nonnull CLLocation*) currentLocation
limit: (NSUInteger) limit
callback: (nullable void (^) (NSArray<ACPPlacesPoi*>* _Nullable nearbyPoi)) callback
errorCallback: (nullable void (^) (ACPPlacesRequestError result)) errorCallback;

processRegionEvent

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

The order of parameters has the PlacesRegionEvent first, and the CLRegion that triggered the event second. This aligns better with Swift API naming conventions.

static func processRegionEvent(_ regionEvent: PlacesRegionEvent,
forRegion region: CLRegion)
AEP 3.x (Objective-C)
+ (void) processRegionEvent: (AEPRegionEventType) eventType
forRegion: (nonnull CLRegion*) region;
ACP 2.x (Objective-C)

The order of parameters has the CLRegion that triggered the event first, and the ACPRegionEventType second.

+ (void) processRegionEvent: (nonnull CLRegion*) region
forRegionEventType: (ACPRegionEventType) eventType;

registerExtension

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

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

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

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

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

setAuthorizationStatus

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func setAuthorizationStatus(status: CLAuthorizationStatus)
AEP 3.x (Objective-C)
+ (void) setAuthorizationStatus: (CLAuthorizationStatus) status;
ACP 2.x (Objective-C)
+ (void) setAuthorizationStatus: (CLAuthorizationStatus) status;