Tracking Profiles

Use Search API to monitor regions around POIs using the Flutter plugin

  1. Use Search API to monitor regions around POIs

Use Search API to monitor regions around POIs

Regions creation is enabled on the nearest result of the Search API request. More details in the Monitor POIs documentation

Radius of POI

When you create a Geofence around a POI (previously imported from Woosmap), manually define radius value:

dart
        Future<String?> returnVal = _geofencingFlutterPlugin.setPoiRadius("100");

returnVal.then((value){
    showToast(value!);
}).catchError((error) {
    showToast('An error occurred: ${error.message}');
});

    

or choose user_properties subfield that corresponds to radius value of the Geofence:

dart
        Future<String?> returnVal = _geofencingFlutterPlugin.setPoiRadius("radiusPOI");

returnVal.then((value){
    showToast(value!);
}).catchError((error) {
    showToast('An error occurred: ${error.message}');
});

    

Get POI (Woosmap Assets) from the local database

Call getPois method to get an array of POIs from local DB.

dart
        // Get single POI
Future<List<Poi>?> returnVal = geofencingFlutterPlugin.getPois(poiId);

returnVal.then((pois){
    if (pois != null){
        debugPrint('POIs: ${pois.length}');
    }
}).catchError((error) {
    debugPrint('An error occurred: ${error.message}');
});

// Get all POIs
Future<List<Poi>?> returnVal = geofencingFlutterPlugin.getPois();

returnVal.then((pois){
    if (pois != null){
        debugPrint('POIs: ${pois.length}');
    }
}).catchError((error) {
    debugPrint('An error occurred: ${error.message}');
});

    

Remove POI (Woosmap Assets)

Call removePois method to remove all POIs

dart
        Future<String?> returnVal = geofencingFlutterPlugin.removePois();

returnVal.then((value){
    debugPrint(value!);
}).catchError((error) {
    debugPrint('An error occurred: ${error.message}');
});

    

Refresh POI (Woosmap Assets)

Call the refreshPois method to get updated information about POIs from the Woosmap server

dart
        Future<String?> returnVal = geofencingFlutterPlugin.refreshPois();

returnVal.then((value){
    debugPrint(value!);
}).catchError((error) {
    debugPrint('An error occurred: ${error.message}');
});

    
Was this article helpful?
Have more questions? Submit a request