The LocationManager class provides methods for gathering location data, creating and monitoring geofences. The following summarizes the commonly used methods of the LocationManager class for Tealium Kotlin. For additional details, explore Location .
Provides to ability to manually create and add geofences for monitoring.
45.0, // latitude
100.0, // longitude
100, // radius
-1, // expiry duration
0, // loiter duration
true, // events triggered on entry of geofence
true) // events triggered on exit of geofence
Name of location
Latitude of location
Longitude of location
Radius in meters of geofence
Sets expiration duration in milliseconds for geofence
Sets duration in milliseconds for time delay between entering and dwelling a geofence
Enables events being triggered upon entering a geofence
Enables events being triggered upon exiting a geofence
Returns a list of all geofence names to be observed.
Returns most recent location recorded for a user’s device or null if location is not available.
val location = tealiumInstance.location?.lastLocation()
Returns the latitude for the most recent location recorded for a user’s device.
val latitude = tealiumInstance.location?.lastLocationLatitude()
Returns the longitude for the most recent location recorded for a user’s device.
val longitude = tealiumInstance.location?.lastLocationLongitude()
Starts continuous location tracking, as well as sets desired accuracy and preferred interval in milliseconds for location updates. Enabling precise location and frequent location update intervals may be costly to battery consumption.