Migrating to AEPPlaces reference
This document is a reference comparison of AEPPlaces (3.x) APIs against 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
Copied to your clipboardstatic func clear()
Copied to your clipboard+ (void) clear;
Copied to your clipboard+ (void) clear;
Copied to your clipboardstatic func clear()
Copied to your clipboard+ (void) clear;
Copied to your clipboard+ (void) clear;
extensionVersion
Copied to your clipboardstatic var extensionVersion: String
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Copied to your clipboardstatic var extensionVersion: String
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
getCurrentPointsOfInterest
Copied to your clipboardstatic func getCurrentPointsOfInterest(_ closure: @escaping ([PointOfInterest]) -> Void)
Copied to your clipboard+ (void) getCurrentPointsOfInterest: ^(NSArray<AEPPlacesPoi*>* _Nonnull pois) closure;
Copied to your clipboard+ (void) getCurrentPointsOfInterest: (nullable void (^) (NSArray<ACPPlacesPoi*>* _Nullable userWithinPoi)) callback;
Copied to your clipboardstatic func getCurrentPointsOfInterest(_ closure: @escaping ([PointOfInterest]) -> Void)
Copied to your clipboard+ (void) getCurrentPointsOfInterest: ^(NSArray<AEPPlacesPoi*>* _Nonnull pois) closure;
Copied to your clipboard+ (void) getCurrentPointsOfInterest: (nullable void (^) (NSArray<ACPPlacesPoi*>* _Nullable userWithinPoi)) callback;
getLastKnownLocation
Copied to your clipboardstatic func getLastKnownLocation(_ closure: @escaping (CLLocation?) -> Void)
Copied to your clipboard+ (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.
Copied to your clipboard+ (void) getLastKnownLocation: (nullable void (^) (CLLocation* _Nullable lastLocation)) callback;
Copied to your clipboardstatic func getLastKnownLocation(_ closure: @escaping (CLLocation?) -> Void)
Copied to your clipboard+ (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.
Copied to your clipboard+ (void) getLastKnownLocation: (nullable void (^) (CLLocation* _Nullable lastLocation)) callback;
getNearbyPointsOfInterest
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.
Copied to your clipboardstatic func getNearbyPointsOfInterest(forLocation location: CLLocation,withLimit limit: UInt,closure: @escaping ([PointOfInterest], PlacesQueryResponseCode) -> Void)
Copied to your clipboard+ (void) getNearbyPointsOfInterest: (nonnull CLLocation*) currentLocationlimit: (NSUInteger) limitcallback: ^ (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.
Copied to your clipboard// without error handling+ (void) getNearbyPointsOfInterest: (nonnull CLLocation*) currentLocationlimit: (NSUInteger) limitcallback: (nullable void (^) (NSArray<ACPPlacesPoi*>* _Nullable nearbyPoi)) callback;// with error handling+ (void) getNearbyPointsOfInterest: (nonnull CLLocation*) currentLocationlimit: (NSUInteger) limitcallback: (nullable void (^) (NSArray<ACPPlacesPoi*>* _Nullable nearbyPoi)) callbackerrorCallback: (nullable void (^) (ACPPlacesRequestError result)) errorCallback;
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.
Copied to your clipboardstatic func getNearbyPointsOfInterest(forLocation location: CLLocation,withLimit limit: UInt,closure: @escaping ([PointOfInterest], PlacesQueryResponseCode) -> Void)
Copied to your clipboard+ (void) getNearbyPointsOfInterest: (nonnull CLLocation*) currentLocationlimit: (NSUInteger) limitcallback: ^ (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.
Copied to your clipboard// without error handling+ (void) getNearbyPointsOfInterest: (nonnull CLLocation*) currentLocationlimit: (NSUInteger) limitcallback: (nullable void (^) (NSArray<ACPPlacesPoi*>* _Nullable nearbyPoi)) callback;// with error handling+ (void) getNearbyPointsOfInterest: (nonnull CLLocation*) currentLocationlimit: (NSUInteger) limitcallback: (nullable void (^) (NSArray<ACPPlacesPoi*>* _Nullable nearbyPoi)) callbackerrorCallback: (nullable void (^) (ACPPlacesRequestError result)) errorCallback;
processRegionEvent
The order of parameters has the PlacesRegionEvent
first, and the CLRegion
that triggered the event second. This aligns better with Swift API naming conventions.
Copied to your clipboardstatic func processRegionEvent(_ regionEvent: PlacesRegionEvent,forRegion region: CLRegion)
Copied to your clipboard+ (void) processRegionEvent: (AEPRegionEventType) eventTypeforRegion: (nonnull CLRegion*) region;
The order of parameters has the CLRegion
that triggered the event first, and the ACPRegionEventType
second.
Copied to your clipboard+ (void) processRegionEvent: (nonnull CLRegion*) regionforRegionEventType: (ACPRegionEventType) eventType;
The order of parameters has the PlacesRegionEvent
first, and the CLRegion
that triggered the event second. This aligns better with Swift API naming conventions.
Copied to your clipboardstatic func processRegionEvent(_ regionEvent: PlacesRegionEvent,forRegion region: CLRegion)
Copied to your clipboard+ (void) processRegionEvent: (AEPRegionEventType) eventTypeforRegion: (nonnull CLRegion*) region;
The order of parameters has the CLRegion
that triggered the event first, and the ACPRegionEventType
second.
Copied to your clipboard+ (void) processRegionEvent: (nonnull CLRegion*) regionforRegionEventType: (ACPRegionEventType) eventType;
registerExtension
Registration occurs by passing Places
to the MobileCore.registerExtensions
API.
Copied to your clipboardMobileCore.registerExtensions([Places.self])
Registration occurs by passing AEPMobilePlaces
to the [AEPMobileCore registerExtensions:completion:]
API.
Copied to your clipboard[AEPMobileCore registerExtensions:@[AEPMobilePlaces.class] completion:nil];
Copied to your clipboard+ (void) registerExtension;
Registration occurs by passing Places
to the MobileCore.registerExtensions
API.
Copied to your clipboardMobileCore.registerExtensions([Places.self])
Registration occurs by passing AEPMobilePlaces
to the [AEPMobileCore registerExtensions:completion:]
API.
Copied to your clipboard[AEPMobileCore registerExtensions:@[AEPMobilePlaces.class] completion:nil];
Copied to your clipboard+ (void) registerExtension;
setAuthorizationStatus
Copied to your clipboardstatic func setAuthorizationStatus(status: CLAuthorizationStatus)
Copied to your clipboard+ (void) setAuthorizationStatus: (CLAuthorizationStatus) status;
Copied to your clipboard+ (void) setAuthorizationStatus: (CLAuthorizationStatus) status;
Copied to your clipboardstatic func setAuthorizationStatus(status: CLAuthorizationStatus)
Copied to your clipboard+ (void) setAuthorizationStatus: (CLAuthorizationStatus) status;
Copied to your clipboard+ (void) setAuthorizationStatus: (CLAuthorizationStatus) status;
For additional details, please read the Places API reference.