This document is a reference comparison of ACPPlaces (2.x) APIs against their equivalent APIs in AEPPlaces (4.x).
If explanation beyond showing API differences is necessary, it will be captured as a "Note" within that API's section.
For example:
Note: This is information that is important to help clarify the API.
The class name containing public APIs is different depending on which SDK and language combination being used.
SDK Version | Language | Class Name | Example |
---|---|---|---|
ACPPlaces | Objective-C | ACPPlaces |
[ACPPlaces clear]; |
AEPPlaces | Objective-C | AEPMobilePlaces |
[AEPMobilePlaces clear]; |
AEPPlaces | Swift | Places |
Places.clear() |
ACPPlaces (Objective-C) | AEPPlaces (Objective-C) | AEPPlaces (Swift) |
---|---|---|
ACPPlacesRequestError |
AEPPlacesQueryResponseCode |
PlacesQueryResponseCode |
ACPPlacesPoi |
AEPPlacesPoi |
PointOfInterest |
ACPRegionEventType |
AEPPlacesRegionEvent |
PlacesRegionEvent |
- clear
- extensionVersion
- getCurrentPointsOfInterest
- getLastKnownLocation
- getNearbyPointsOfInterest
- processRegionEvent
- registerExtension
- setAuthorizationStatus
ACPPlaces (Objective-C)
+ (void) clear;
AEPPlaces (Objective-C)
+ (void) clear;
AEPPlaces (Swift)
static func clear()
ACPPlaces (Objective-C)
+ (nonnull NSString*) extensionVersion;
AEPPlaces (Objective-C)
+ (nonnull NSString*) extensionVersion;
AEPPlaces (Swift)
static var extensionVersion: String
ACPPlaces (Objective-C)
+ (void) getCurrentPointsOfInterest: (nullable void (^) (NSArray<ACPPlacesPoi*>* _Nullable userWithinPoi)) callback;
AEPPlaces (Objective-C)
+ (void) getCurrentPointsOfInterest: ^(NSArray<AEPPlacesPoi*>* _Nonnull pois) closure;
AEPPlaces (Swift)
static func getCurrentPointsOfInterest(_ closure: @escaping ([PointOfInterest]) -> Void)
ACPPlaces (Objective-C)
Note: If the SDK has no last known location, it will pass a
CLLocation
object with a value of999.999
for latitude and longitude to the callback.
+ (void) getLastKnownLocation: (nullable void (^) (CLLocation* _Nullable lastLocation)) callback;
AEPPlaces (Objective-C)
+ (void) getLastKnownLocation: ^(CLLocation* _Nullable lastLocation) closure;
AEPPlaces (Swift)
Note: If the SDK has no last known location, it will pass
nil
to the closure.
static func getLastKnownLocation(_ closure: @escaping (CLLocation?) -> Void)
ACPPlaces (Objective-C)
Note: Two
getNearbyPointsOfInterest
methods exist. The overloaded version allows the caller to provide anerrorCallback
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;
AEPPlaces (Objective-C)
+ (void) getNearbyPointsOfInterest: (nonnull CLLocation*) currentLocation
limit: (NSUInteger) limit
callback: ^ (NSArray<AEPPlacesPoi*>* _Nonnull, AEPPlacesQueryResponseCode) closure;
AEPPlaces (Swift)
Note: 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)
ACPPlaces (Objective-C)
Note: The order of parameters has the
CLRegion
that triggered the event first, and theACPRegionEventType
second.
+ (void) processRegionEvent: (nonnull CLRegion*) region
forRegionEventType: (ACPRegionEventType) eventType;
AEPPlaces (Objective-C)
+ (void) processRegionEvent: (AEPRegionEventType) eventType
forRegion: (nonnull CLRegion*) region;
AEPPlaces (Swift)
Note: The order of parameters has the
PlacesRegionEvent
first, and theCLRegion
that triggered the event second. This aligns better with Swift API naming conventions.
static func processRegionEvent(_ regionEvent: PlacesRegionEvent,
forRegion region: CLRegion)
ACPPlaces (Objective-C)
+ (void) registerExtension;
AEPPlaces (Objective-C)
Note: Registration occurs by passing
AEPMobilePlaces
to the[AEPMobileCore registerExtensions:completion:]
API.
[AEPMobileCore registerExtensions:@[AEPMobilePlaces.class] completion:nil];
AEPPlaces (Swift)
Note: Registration occurs by passing
Places
to theMobileCore.registerExtensions
API.
MobileCore.registerExtensions([Places.self])
ACPPlaces (Objective-C)
+ (void) setAuthorizationStatus: (CLAuthorizationStatus) status;
AEPPlaces (Objective-C)
+ (void) setAuthorizationStatus: (CLAuthorizationStatus) status;
AEPPlaces (Swift)
static func setAuthorizationStatus(_ status: CLAuthorizationStatus)