Edit in GitHubLog an issue

Java

Example

Copied to your clipboard
Places.clear();

Kotlin

Example

Copied to your clipboard
Places.clear()

Swift

Syntax

Copied to your clipboard
static func clear()

Example

Copied to your clipboard
Places.clear()

Objective-C

Syntax

Copied to your clipboard
+ (void) clear;

Example

Copied to your clipboard
[AEPMobilePlaces clear];

Java

Example

Copied to your clipboard
String placesExtensionVersion = Places.extensionVersion();

Kotlin

Example

Copied to your clipboard
val placesExtensionVersion: String = Places.extensionVersion()

Swift

Syntax

Copied to your clipboard
static var extensionVersion: String

Example

Copied to your clipboard
let placesVersion = Places.extensionVersion

Objective-C

Syntax

Copied to your clipboard
+ (nonnull NSString*) extensionVersion;

Example

Copied to your clipboard
NSString *placesVersion = [AEPMobilePlaces extensionVersion];

Java

Example

Copied to your clipboard
Places.getCurrentPointsOfInterest(new AdobeCallback<List<PlacesPOI>>() {
@Override
public void call(List<PlacesPOI> pois) {
// use the obtained POIs that the device is within
processUserWithinPois(pois);
}
});

Kotlin

Example

Copied to your clipboard
Places.getCurrentPointsOfInterest() { pois ->
// use the obtained POIs that the device is within
processUserWithinPois(pois)
}

Swift

Syntax

Copied to your clipboard
static func getCurrentPointsOfInterest(_ closure: @escaping ([PointOfInterest]) -> Void)

Example

Copied to your clipboard
Places.getCurrentPointsOfInterest() { currentPois in
print("currentPois: (currentPois)")
}

Objective-C

Syntax

Copied to your clipboard
+ (void) getCurrentPointsOfInterest: ^(NSArray<AEPPlacesPoi*>* _Nonnull pois) closure;

Example

Copied to your clipboard
[AEPMobilePlaces getCurrentPointsOfInterest:^(NSArray<AEPPlacesPoi *> *pois) {
NSLog(@"currentPois: %@", pois);
}];

Java

Example

Copied to your clipboard
Places.getLastKnownLocation(new AdobeCallback<Location>() {
@Override
public void call(Location lastLocation) {
// do something with the last known location
processLastKnownLocation(lastLocation);
}
});

Kotlin

Example

Copied to your clipboard
Places.getLastKnownLocation() { lastLocation ->
// do something with the last known location
processLastKnownLocation(lastLocation)
}

Swift

Syntax

Copied to your clipboard
static func getLastKnownLocation(_ closure: @escaping (CLLocation?) -> Void)

Example

Copied to your clipboard
Places.getLastKnownLocation() { location in
if let location = location {
print("location returned from closure: ((location.coordinate.latitude), (location.coordinate.longitude))")
}
}

Objective-C

Syntax

Copied to your clipboard
+ (void) getLastKnownLocation: ^(CLLocation* _Nullable lastLocation) closure;

Example

Copied to your clipboard
[AEPMobilePlaces getLastKnownLocation:^(CLLocation *location) {
if (location) {
NSLog(@"location returned from closure: (%f, %f)", location.coordinate.latitude, location.coordinate.longitude);
}
}];

Java

Syntax

Copied to your clipboard
public static void getNearbyPointsOfInterest(@NonNull final Location location,
final int limit,
@NonNull final AdobeCallback<List<PlacesPOI>> successCallback,
@NonNull final AdobeCallback<PlacesRequestError> errorCallback);

Example

Copied to your clipboard
Places.getNearbyPointsOfInterest(currentLocation, 10,
new AdobeCallback<List<PlacesPOI>>() {
@Override
public void call(List<PlacesPOI> pois) {
// do required processing with the returned nearbyPoi array
startMonitoringPois(pois);
}
}, new AdobeCallback<PlacesRequestError>() {
@Override
public void call(PlacesRequestError placesRequestError) {
// look for the placesRequestError and handle the error accordingly
handleError(placesRequestError);
}
}
);

Kotlin

Example

Copied to your clipboard
Places.getNearbyPointsOfInterest(currentLocation, 10, { pois ->
// do required processing with the returned nearbyPoi array
startMonitoringPois(pois);
}, { error ->
// look for the placesRequestError and handle the error accordingly
handleError(placesRequestError);
})

Swift

Syntax

Copied to your clipboard
static func getNearbyPointsOfInterest(forLocation location: CLLocation,
withLimit limit: UInt,
closure: @escaping ([PointOfInterest], PlacesQueryResponseCode) -> Void)

Example

Copied to your clipboard
let location = CLLocation(latitude: 40.4350229, longitude: -111.8918356)
Places.getNearbyPointsOfInterest(forLocation: location, withLimit: 10) { (nearbyPois, responseCode) in
print("responseCode: (responseCode.rawValue) - nearbyPois: (nearbyPois)")
}

Objective-C

Syntax

Copied to your clipboard
+ (void) getNearbyPointsOfInterest: (nonnull CLLocation*) currentLocation
limit: (NSUInteger) limit
callback: ^ (NSArray<AEPPlacesPoi*>* _Nonnull, AEPPlacesQueryResponseCode) closure;

Example

Copied to your clipboard
CLLocation *location = [[CLLocation alloc] initWithLatitude:40.4350229 longitude:-111.8918356];
[AEPMobilePlaces getNearbyPointsOfInterest:location
limit:10
callback:^(NSArray<AEPPlacesPoi *> *pois, AEPPlacesQueryResponseCode responseCode) {
NSLog(@"responseCode: %ld", (long)responseCode);
NSLog(@"nearbyPois: %@", pois);
}];

Java

Syntax

Copied to your clipboard
public static void processGeofence(final Geofence geofence, final int transitionType);

Example

Copied to your clipboard
public class GeofenceTransitionsIntentService extends IntentService {
public GeofenceTransitionsIntentService() {
super("GeofenceTransitionsIntentService");
}
protected void onHandleIntent(Intent intent) {
GeofencingEvent geofencingEvent = GeofencingEvent.fromIntent(intent);
List<Geofence> geofences = geofencingEvent.getTriggeringGeofences();
if (geofences.size() > 0) {
// Call the Places API to process information
Places.processGeofence(geofences.get(0), geofencingEvent.getGeofenceTransition());
}
}
}

Kotlin

Example

Copied to your clipboard
fun onHandleIntent(intent: Intent) {
val geofencingEvent = GeofencingEvent.fromIntent(intent)
val geofences = geofencingEvent.getTriggeringGeofences()
if (!geofences.isEmpty()) {
Places.processGeofence(geofences.first(), geofencingEvent.getGeofenceTransition())
}
}

Java

Syntax

Copied to your clipboard
public static void processGeofenceEvent(@NonNull final GeofencingEvent geofencingEvent);

Example

Copied to your clipboard
public class GeofenceTransitionsIntentService extends IntentService {
public GeofenceTransitionsIntentService() {
super("GeofenceTransitionsIntentService");
}
protected void onHandleIntent(Intent intent) {
GeofencingEvent geofencingEvent = GeofencingEvent.fromIntent(intent);
// Call the Places API to process information
Places.processGeofenceEvent(geofencingEvent);
}
}

Kotlin

Example

Copied to your clipboard
fun onHandleIntent(intent: Intent) {
val geofencingEvent = GeofencingEvent.fromIntent(intent)
// Call the Places API to process information
Places.processGeofenceEvent(geofencingEvent)
}

Swift

Syntax

Copied to your clipboard
static func processRegionEvent(_ regionEvent: PlacesRegionEvent,
forRegion region: CLRegion)

Example

Copied to your clipboard
let region = CLCircularRegion(center: CLLocationCoordinate2D(latitude: 40.3886845, longitude: -111.8284979),
radius: 100,
identifier: "877677e4-3004-46dd-a8b1-a609bd65a428")
Places.processRegionEvent(.entry, forRegion: region)

Objective-C

Syntax

Copied to your clipboard
+ (void) processRegionEvent: (AEPRegionEventType) eventType
forRegion: (nonnull CLRegion*) region;

Example

Copied to your clipboard
CLCircularRegion *region = [[CLCircularRegion alloc] initWithCenter:CLLocationCoordinate2DMake(40.3886845, -111.8284979)
radius:100
identifier:@"877677e4-3004-46dd-a8b1-a609bd65a428"];
[AEPMobilePlaces processRegionEvent:AEPPlacesRegionEventEntry forRegion:region];

Java

Example

Copied to your clipboard
Places.registerExtension();

Kotlin

Example

Copied to your clipboard
Places.registerExtension()

Swift

Example

Copied to your clipboard
MobileCore.registerExtensions([Places.self])

Objective-C

Example

Copied to your clipboard
[AEPMobileCore registerExtensions:@[AEPMobilePlaces.class] completion:nil];

Swift

Syntax

Copied to your clipboard
static func setAccuracyAuthorization(_ accuracy: CLAccuracyAuthorization)

Example

Copied to your clipboard
Places.setAccuracyAuthorization(.fullAccuracy)

Objective-C

Syntax

Copied to your clipboard
+ (void) setAccuracyAuthorization: (CLAccuracyAuthorization) accuracy;

Example

Copied to your clipboard
[AEPMobilePlaces setAccuracyAuthorization:CLAccuracyAuthorizationFullAccuracy];

Java

Syntax

Copied to your clipboard
public static void setAuthorizationStatus(final PlacesAuthorizationStatus status);

Example

Copied to your clipboard
Places.setAuthorizationStatus(PlacesAuthorizationStatus.ALWAYS);

Kotlin

Example

Copied to your clipboard
Places.setAuthorizationStatus(PlacesAuthorizationStatus.ALWAYS)

Swift

Syntax

Copied to your clipboard
static func setAuthorizationStatus(status: CLAuthorizationStatus)

Example

Copied to your clipboard
// in the class implementing CLLocationManagerDelegate:
func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
Places.setAuthorizationStatus(status: manager.authorizationStatus)
}

Objective-C

Syntax

Copied to your clipboard
+ (void) setAuthorizationStatus: (CLAuthorizationStatus) status;

Example

Copied to your clipboard
// in the class implementing CLLocationManagerDelegate:
- (void)locationManagerDidChangeAuthorization:(CLLocationManager *)manager {
[AEPMobilePlaces setAuthorizationStatus:manager.authorizationStatus];
}
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2025 Adobe. All rights reserved.