How to implement Geofence for tracking another users?
I am developing an application which will track family members, and I want to implement Geofence feature which will enable user to do for ex:
user A will track user B
user A will determine the geofence area and when user B will enter this geofence user A will get a notification
I retreived the location of user B every 10 minutes and I want to create Geofence for user B which will notify user A when user B enter the geofence area
I try to use google Geofence like this code :
mGeofenceList.add(new Geofence.Builder()
// Set the request ID of the geofence. This is a string to identify this
// geofence.
.setRequestId(entry.getKey())
.setCircularRegion(
entry.getValue().latitude,
entry.getValue().longitude,
Constants.GEOFENCE_RADIUS_IN_METERS
)
.setExpirationDuration(Constants.GEOFENCE_EXPIRATION_IN_MILLISECONDS)
.setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER |
Geofence.GEOFENCE_TRANSITION_EXIT)
.build());
but it just work for the user device "user A location" not for another user location.