Loading...
Searching...
No Matches
NavigationManagerExample Class Reference
+ Inheritance diagram for NavigationManagerExample:

Public Member Functions

(void) - onPositionUpdated:
 Called when new position has been calculated.
 
(void) - onPositionError:
 Called if unable to calculate user's position.
 
(void) - onLocationLoaded:
 Called when new location version has been downloaded from server or load it from the storage.
 
(void) - onLocationFailed:error:
 Called if unable to download location version from CMS.
 

Properties

NCNavigineSdksdk
 
NCLocationManagerlocationManager
 
NCNavigationManagernavigationManager
 

Detailed Description

NavigationManager usage example for Dart/Flutter Demonstrates working with navigation, positioning, and location tracking

NavigationManager usage example for Objective-C Demonstrates working with navigation, positioning, and location tracking

Definition at line 9 of file navigation_manager_example.dart.

Member Function Documentation

◆ onLocationFailed:error:

- (void) onLocationFailed: (int32_t) locationId
error: (nullable NSError *) error 

Called if unable to download location version from CMS.

Parameters
locationIdlocation unique identifier in SMC.
errorhandled error.

Swift code snippet:

func onLocationFailed(_ locationId: Int32, error: Error?) {
print("Failed to load location \‍(locationId): \‍(error?.localizedDescription ?? "Unknown error")")
}

Objective C code snippet:

- (void)onLocationFailed:(int32_t)locationId error:(NSError *)error {
NSLog(@"Failed to load location %d: %@", locationId, error.localizedDescription);
}

◆ onLocationLoaded:

- (void) onLocationLoaded: (nullable NCLocation *) location

Called when new location version has been downloaded from server or load it from the storage.

Parameters
locationLocation instance or nil if server url or USER_HASH was changed.

Swift code snippet:

func onLocationLoaded(_ location: NCLocation?) {
print("Location loaded successfully")
currentLocation = location
if let location = location {
demonstrateLocationUsage(location)
}
}

Objective C code snippet:

- (void)onLocationLoaded:(NCLocation *)location {
NSLog(@"Location loaded successfully");
self.currentLocation = location;
if (location != nil) {
[self demonstrateLocationUsage:location];
}
}

◆ onPositionError:

- (void) onPositionError: (nullable NSError *) error

Called if unable to calculate user's position.

Parameters
errorhandled error.

Swift code snippet:

func onPositionError(_ error: Error?) {
if let error = error {
print("Position error: \‍(error.localizedDescription)")
}
}

Objective C code snippet:

- (void)onPositionError:(NSError *)error {
NSLog(@"Position error: %@", error.localizedDescription);
}

◆ onPositionUpdated:

- (void) onPositionUpdated: (nonnull NCPosition *) position

Called when new position has been calculated.

Parameters
positioncurrent user Position.

Swift code snippet:

func onPositionUpdated(_ position: NCPosition) {
print("Position updated successfully")
demonstratePositionUsage(position)
}

Objective C code snippet:

- (void)onPositionUpdated:(NCPosition *)position {
NSLog(@"Position updated successfully");
[self demonstratePositionUsage:position];
}

Property Documentation

◆ locationManager

NCLocationManager* NavigationManagerExample.locationManager
readwritenonatomicstrong

Definition at line 19 of file NavigationManagerExample.m.

◆ navigationManager

NCNavigationManager* NavigationManagerExample.navigationManager
readwritenonatomicstrong

Definition at line 20 of file NavigationManagerExample.m.

◆ sdk

NCNavigineSdk* NavigationManagerExample.sdk
readwritenonatomicstrong

Definition at line 18 of file NavigationManagerExample.m.


The documentation for this class was generated from the following files: