import {addSmartGeofenceEventListener} from "@sentiance-react-native/smart-geofences";
const subscription = addSmartGeofenceEventListener(smartGeofenceEvent => {
// Smart geofence entry/exit detected
const eventTime = smartGeofenceEvent.timestamp;
const triggeringLocation = smartGeofenceEvent.triggeringLocation;
const eventType = smartGeofenceEvent.eventType;
const geofences = smartGeofenceEvent.geofences;
geofences.forEach(geofence => {
const sentianceId = geofence.sentianceId;
const latitude = geofence.latitude;
const longitude = geofence.longitude;
const radius = geofence.radius;
const externalId = geofence.externalId;
});
});
// Don't forget to unsubscribe, typically in componentWillUnmount
subscription.remove();