Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

The core component of Navmii SDK responsible for geofencing is NMGeofenceManager. This class provides an API for managing user geofences and transition event notifications.

CREATING GEOFENCE MANAGER

NMSdk class contains a property geofenceManager which allows Navmii SDK user to access geofence manager instance. The geofence manager instance can only be accessed if the SDK is started.

GEOFENCE TYPES

The geofence manager supports two types of geofence geometry:

  • NMGeofenceCircular

  • NMGeofencePolygonal

GEOFENCE EVENTS

The geofence manager provides a NMGeofenceListener interface to handle transition events:

  • - (void)onGeofenceEnter:(nonnull NSString *)geofenceId geofenceTag:(nullable NSString *)geofenceTag;

  • - (void)onGeofenceExit:(nonnull NSString *)geofenceId geofenceTag:(nullable NSString *)geofenceTag;

You can add listeners using addGeofenceListener method:

[sdk.geofenceManager addGeofenceListener:geofenceListener];

Don't forget to detach listeners using removeGeofenceListener method:

[sdk.geofenceManager removeGeofenceListener:geofenceListener];

  • No labels