Class Places

java.lang.Object
com.adobe.marketing.mobile.Places

public class Places extends Object
Public class containing APIs for the Places extension.
  • Field Details

    • EXTENSION

      public static final Class<? extends com.adobe.marketing.mobile.Extension> EXTENSION
      Places extension Class
    • EXTENSION_VERSION

      public static final String EXTENSION_VERSION
      See Also:
  • Method Details

    • extensionVersion

      @NonNull public static String extensionVersion()
      Returns the version of the Places Extension
      Returns:
      A String representing 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 PlacesRequestError in errorCallback to get more information about the reason for the failure.

      Parameters:
      location - a Location object represent the current location of the device
      limit - a non-negative number representing the number of nearby POI to return from the request
      successCallback - called on success, with list of PlacesPOI objects that represent the nearest POI to the device
      errorCallback - called on failure, with PlacesRequestError representing the cause of failure
    • processGeofenceEvent

      public static void processGeofenceEvent(@NonNull com.google.android.gms.location.GeofencingEvent geofencingEvent)
      Pass a GeofencingEvent to 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 - the GeofencingEvent object that occurred while entering/exiting a GeoFence
    • processGeofence

      public static void processGeofence(@NonNull com.google.android.gms.location.Geofence geofence, int transitionType)
      Pass a Geofence and transition type to be processed by the SDK

      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.

      Use this API to pass only the required Geofence obtained from GeofencingEvent.getTriggeringGeofences() which the Places SDK needs to process.

      Pass the transition type from GeofencingEvent.getGeofenceTransition(). Currently we support Geofence.GEOFENCE_TRANSITION_ENTER and Geofence.GEOFENCE_TRANSITION_EXIT transitions.

      Parameters:
      geofence - the Geofence object obtained from the GeofencingEvent
      transitionType - an int representing 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 of PlacesPOI objects 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 a Location object 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

      public static void setAuthorizationStatus(@NonNull PlacesAuthorizationStatus status)
      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