how to get geofence attributes inside a Geofence event.

Davidescu Ioan7 years ago

Hi there,

I have created a new event type and modify the GeofenceEvendHandler.java adding a event when the device is inside the geofence. Now wih the enter and exit from geofence event i have multile Geo-IN events if the device is inside the geofence. I have also added a speedlimit attribute to the geofence. Now I cannot get the attribute value in order to compare the speedlimit set to the Geofence and speed of the device. This speed verification is done only inside the Geofence. I looked over the GeofenceManager and tried to create a function to get that attributes but with out much success.

public Object lookupAttribute(Object geofenceId, String attributeName) {
    Object result = null;
    Geofence geofence = getById(geofenceId);
    if (geofence != null) {
        result = geofence.getAttributes().get(attributeName);
        }
    return result;
    }

and from the GeofenceEventHandler.java i tryed to call it and get that attribute.

I anyone cand help me with a direction it would be great. Thank you.