I've built Geofence as:
GeofenceModel modelExit = new GeofenceModel.Builder("id_oi_456")
.setTransition(Geofence.GEOFENCE_TRANSITION_DWELL)
.setExpiration(Geofence.NEVER_EXPIRE)
.setLatitude(40.414341)
.setLongitude(49.928548)
.setRadius(CLIENT_GEOFENCE_RADIUS)
.build();
SmartLocation.with(this).geofencing()
.add(modelExit)
.start(this);
When set to NEVER_EXPIRE, it gets triggered. When setExpiration() is not set geofence will not be triggered though. The question is that What isdefault expiration time for single geofence?
In regards to Android's
Geofenceclass: it is not possible to create aGeofenceusingGeofence.Builderwithout setting an expiration. If you try to, it will throwjava.lang.IllegalArgumentException: Expiration not set.As for your
GeofenceModelclass, I'm not sure.