Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The main component responsible for navigation in Navmii SDK is NMNavigationSevice. You can access an instance of this class via NMSdknavigationService property:

Code Block
languagecpp
themeEclipse
NMNavigationService *navigationService = [NMSdk sharedInstance].navigationService;


You can set up the location detection accuracy in meters via locationDetectionAccuracy property. To retrieve current user defined CLAuthorizationStatus use locationServicesAuthorizationStatus readonly property. You can allow or disallow location updates when your app is in background mode via allowsBackgroundLocationUpdates BOOL property. 

Code Block
languagecpp
themeEclipse
//sets location detection accuracy to 20 meters
[[NMSdk sharedInstance].navigationService setLocationDetectionAccuracy:20];
//allows user's location updates in the background mode
[[NMSdk sharedInstance].navigationService setAllowsBackgroundLocationUpdates:YES];
//logs out location services authorization status
NSLog(@"authorization status - %d", [NMSdk sharedInstance].navigationService.locationServicesAuthorizationStatus);

 There is also the gpsStatus property indicating if the SDK accepts GPS signal. GPS status is represented as NMGpsStatus enum taking the following values:

  • NMGpsStatusOK
  • NMGpsStatusNoSignal
  • NMGpsStatusOff
Code Block
languagecpp
themeEclipse
//logs out a message if GPS signal is received by the SDK
if ([NMSdk sharedInstance].navigationService.gpsStatus == NMGpsStatusOK) {
	NSLog(@"GPS signal is received");
}


Navmii SDK allows you to demonstrate the way the real-time traverse of the route will look like on the screen. When the route is calculated, use startDemoRoute and stopDemoRoute methods. Use isDemoRouteActive BOOL property to find out if the demo route is still in progress.


Code Block
languagecpp
themeEclipse
//starts demo route
[[NMSdk sharedInstance].navigationService startDemoRoute];
//stops demo route
[[NMSdk sharedInstance].navigationService stopDemoRoute];