Skip to content

GeofenceEvent

classGeofenceEvent

Geofence transition delivered to BGGeo.onGeofence.

The SDK fires this event each time the device crosses a monitored geofence boundary. Each event carries the transition type (ENTER, EXIT, or DWELL), the location recorded at the moment of the crossing, and the full Geofence record that triggered it.

val bgGeo = BGGeo.instance

bgGeo.onGeofence { event ->
    Log.d(TAG, "[onGeofence] ${event.identifier} ${event.action} ${event.location}")
}

Members

action

val action: String

Transition type that fired: ENTER, EXIT, or DWELL.

extras

val extras: Map<String, Any>?

Optional metadata originally configured on the Geofence. Present only when the geofence was created with an extras map.

identifier

val identifier: String

The Geofence.identifier of the geofence that triggered this event.

location

val location:LocationEvent

Location recorded at the moment the geofence boundary was crossed.