kibotu / geofencer

Location tracking & geofencing the easy way. Supports background, killed app, rebooted device different update intervals.
MIT License
129 stars 28 forks source link

[Question] Multiple transition types #7

Closed galadril closed 4 years ago

galadril commented 5 years ago

Is it possible to use multiple transition types? like:


return new Geofence(
                String.valueOf(id),
                latLng.latitude,
                latLng.longitude,
                radius,
                name,
                name,
                GEOFENCE_TRANSITION_ENTER | GEOFENCE_TRANSITION_DWELL | GEOFENCE_TRANSITION_EXIT);

And then check the transition type on the service:

 private void handleEnterExit(Geofence geofence) {
            int transitionType = geofence.getTransitionType();

            if (GEOFENCE_TRANSITION_ENTER == transitionType || GEOFENCE_TRANSITION_DWELL == transitionType) {
Log.d(TAG, "Triggered enteringa geofence location: " + locationFound.getName());
}
}
kibotu commented 4 years ago

good idea!

kibotu commented 4 years ago

actually I just wanted to implement that and it turns out it works already like this