Route geofencing (v2.1.x - iOS)

The core component of Navmii SDK responsible for route geofencing is NMRouteGeofenceManager. This class provides an API that allows getting notifications of transition events within a route with a specified tolerance.

 

CREATING ROUTE GEOFENCE MANAGER

NMSdk class contains a property routeGeofenceManager which allows the Navmii SDK user to access the route geofence manager instance. The route geofence manager instance can only be accessed if the SDK is started. Use route property to set the current route and accuracy property to set an accuracy in meters.

 

ROUTE GEOFENCE EVENTS

The route geofence manager provides a NMRouteGeofenceListener interface to handle transition events:

  • - (void)onRouteGeofenceEnter

  • - (void)onRouteGeofenceExit

You can add listeners using addRouteGeofenceListener method:

[sdk.routeGeofenceManager addRouteGeofenceListener:routeGeofenceListener];

Don't forget to detach listeners using removeGeofenceListener method:

[sdk.routeGeofenceManager removeRouteGeofenceListener:routeGeofenceListener];