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.
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 |
AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
static func clear()
+ (void) clear;
+ (void) clear;
AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
static var extensionVersion: String
+ (nonnull NSString*) extensionVersion;
+ (nonnull NSString*) extensionVersion;
AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
static func getCurrentPointsOfInterest(_ closure: @escaping ([PointOfInterest]) -> Void)
+ (void) getCurrentPointsOfInterest: ^(NSArray<AEPPlacesPoi*>* _Nonnull pois) closure;
+ (void) getCurrentPointsOfInterest: (nullable void (^) (NSArray<ACPPlacesPoi*>* _Nullable userWithinPoi)) callback;
AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
static func getLastKnownLocation(_ closure: @escaping (CLLocation?) -> Void)
+ (void) getLastKnownLocation: ^(CLLocation* _Nullable lastLocation) closure;
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;
AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
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)
+ (void) getNearbyPointsOfInterest: (nonnull CLLocation*) currentLocation
limit: (NSUInteger) limit
callback: ^ (NSArray<AEPPlacesPoi*>* _Nonnull, AEPPlacesQueryResponseCode) closure;
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;
AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
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)
+ (void) processRegionEvent: (AEPRegionEventType) eventType
forRegion: (nonnull CLRegion*) region;
The order of parameters has the
CLRegion
that triggered the event first, and the ACPRegionEventType
second.+ (void) processRegionEvent: (nonnull CLRegion*) region
forRegionEventType: (ACPRegionEventType) eventType;
AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
Registration occurs by passing
Places
to the MobileCore.registerExtensions
API.MobileCore.registerExtensions([Places.self])
Registration occurs by passing
AEPMobilePlaces
to the [AEPMobileCore registerExtensions:completion:]
API.[AEPMobileCore registerExtensions:@[AEPMobilePlaces.class] completion:nil];
+ (void) registerExtension;
AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
static func setAuthorizationStatus(status: CLAuthorizationStatus)
+ (void) setAuthorizationStatus: (CLAuthorizationStatus) status;
+ (void) setAuthorizationStatus: (CLAuthorizationStatus) status;