Class Places
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()Clears out the client-side data for Places in shared state, local storage, and in-memory.static StringReturns the version of thePlacesExtensionstatic voidgetCurrentPointsOfInterest(com.adobe.marketing.mobile.AdobeCallback<List<PlacesPOI>> callback) Returns all Points of Interest (POI) in which the device is currently known to be within.static voidgetLastKnownLocation(com.adobe.marketing.mobile.AdobeCallback<Location> callback) Returns the last known Location of the device provided to the Places Extension.static voidgetNearbyPointsOfInterest(Location location, int limit, com.adobe.marketing.mobile.AdobeCallback<List<PlacesPOI>> successCallback, com.adobe.marketing.mobile.AdobeCallback<PlacesRequestError> errorCallback) Requests a list of nearby Points of Interest (POI) and returns them in a success callback.static voidprocessGeofence(com.google.android.gms.location.Geofence geofence, int transitionType) Pass aGeofenceand transition type to be processed by the SDKstatic voidprocessGeofenceEvent(com.google.android.gms.location.GeofencingEvent geofencingEvent) Pass aGeofencingEventto be processed by the SDK.static voidSets the authorization status in the Places extension.
-
Field Details
-
EXTENSION
Places extension Class -
EXTENSION_VERSION
- See Also:
-
-
Method Details
-
extensionVersion
Returns the version of thePlacesExtension- Returns:
- A
Stringrepresenting the extension version
-
getNearbyPointsOfInterest
public static void getNearbyPointsOfInterest(@NonNull Location location, int limit, @NonNull com.adobe.marketing.mobile.AdobeCallback<List<PlacesPOI>> successCallback, @NonNull com.adobe.marketing.mobile.AdobeCallback<PlacesRequestError> errorCallback) Requests a list of nearby Points of Interest (POI) and returns them in a success callback.Either successCallback or errorCallback is called depending upon the status of the get near by points of interest call. Look for
PlacesRequestErrorin errorCallback to get more information about the reason for the failure.- Parameters:
location- aLocationobject represent the current location of the devicelimit- a non-negative number representing the number of nearby POI to return from the requestsuccessCallback- called on success, with list ofPlacesPOIobjects that represent the nearest POI to the deviceerrorCallback- called on failure, withPlacesRequestErrorrepresenting the cause of failure
-
processGeofenceEvent
public static void processGeofenceEvent(@NonNull com.google.android.gms.location.GeofencingEvent geofencingEvent) Pass aGeofencingEventto be processed by the SDK.Processes a place/geofence event in the sdk. Used for passive data collection (Analytics, Target, Audience Manager) and triggering actions using rules (In-app messaging, Postbacks, PII Request, Target profile updates, Audience Manager sync calls)
Calling this method will result in an Event being dispatched in the SDK, allowing for rules to be processed as a result of the triggering event.
- Parameters:
geofencingEvent- theGeofencingEventobject that occurred while entering/exiting a GeoFence
-
processGeofence
public static void processGeofence(@NonNull com.google.android.gms.location.Geofence geofence, int transitionType) Pass aGeofenceand transition type to be processed by the SDKCalling this method will result in an Event being dispatched in the SDK, allowing for rules to be processed as a result of the triggering event.
Use this API to pass only the required
Geofenceobtained fromGeofencingEvent.getTriggeringGeofences()which the Places SDK needs to process.Pass the transition type from
GeofencingEvent.getGeofenceTransition(). Currently we supportGeofence.GEOFENCE_TRANSITION_ENTERandGeofence.GEOFENCE_TRANSITION_EXITtransitions.- Parameters:
geofence- theGeofenceobject obtained from theGeofencingEventtransitionType- anintrepresenting the transition type for the passed geofence
-
getCurrentPointsOfInterest
public static void getCurrentPointsOfInterest(@NonNull com.adobe.marketing.mobile.AdobeCallback<List<PlacesPOI>> callback) Returns all Points of Interest (POI) in which the device is currently known to be within.Returns empty array when the device is not within any of the configured POIs.
- Parameters:
callback- called with the list ofPlacesPOIobjects that represent the POIs within which the user is currently in
-
getLastKnownLocation
public static void getLastKnownLocation(@NonNull com.adobe.marketing.mobile.AdobeCallback<Location> callback) Returns the last known Location of the device provided to the Places Extension.Returns null, if the SDK doesn't know the last known location. Returns null, if the last known location has invalid latitude/longitude or any other error occurred while retrieving location.
- Parameters:
callback- called with aLocationobject representing the last known lat/lon provided to the extension
-
clear
public static void clear()Clears out the client-side data for Places in shared state, local storage, and in-memory. -
setAuthorizationStatus
Sets the authorization status in the Places extension.The status provided is stored in the Places shared state, and is for reference only. Calling this method does not impact the actual location authorization status for this device.
- Parameters:
status- the PlacesAuthorizationStatus to be set for this device
-