Utilize the Smart Geofences API
Listen to smart geofence entry/exit events
// Create an instance of the delegate that will handle the events.
private let smartGeofenceEventDelegate = MySmartGeofenceEventDelegate()
// Set the delegate on the Sentiance SDK. Note that the SDK holds a weak
// reference to this delegate.
Sentiance.shared.smartGeofenceEventsDelegate = smartGeofenceEventDelegate
// Define the delegate class that will handle the events.
class MySmartGeofenceEventDelegate: SmartGeofenceEventDelegate {
func onSmartGeofenceEvent(_ smartGeofenceEvent: SmartGeofenceEvent) {
// Handle the events here.
}
}import com.sentiance.sdk.smartgeofences.api.SmartGeofenceApi
SmartGeofenceApi.getInstance(mContext).setSmartGeofenceEventListener { event ->
// Handle the events here.
}import {addSmartGeofenceEventListener} from "@sentiance-react-native/smart-geofences";
// If you're subscribing to event updates only in the foreground, make sure
// to call subscription.remove() inside your component's componentWillUnmount() function
const subscription = addSmartGeofenceEventListener(smartGeofenceEvent => {
// Handle the events here.
});Refresh the list of monitored geofences
Get the current smart geofences detection mode
Last updated