Loading...
Searching...
No Matches
NCLocationManager Class Reference

Class is used for downloading and working with Location. More...

#include <com/navigine/idl/objc/NCLocationManager.h>

Inherits NSObject.

Instance Methods

(void) - addLocationListener:
 Method is used to add LocationListener element which will notify about newly downloaded and set location.
 
(void) - removeLocationListener:
 Method is used for removing previously added LocationListener class element.
 
(void) - setLocationId:
 Method is used for setting current location, which will be downloaded from server or from storage, if it was downloaded before. Result will be handled by LocationListener.
 
(int32_t) - getLocationId
 Method returns current location unique identifier.
 
(void) - setLocationUpdateInterval:
 Method is used to change interval in seconds check for new version from server Default: 300s.
 

Detailed Description

Class is used for downloading and working with Location.

Referenced from NavigineSdk.

Definition at line 18 of file NCLocationManager.h.

Method Documentation

◆ addLocationListener:

- (void) addLocationListener: (nullable id< NCLocationListener >) listener

Method is used to add LocationListener element which will notify about newly downloaded and set location.

Note
Do not forget to remove listener if it is no longer needed!
Parameters
listenerСorresponding LocationListener class.

Swift code snippet:

// Add location listener
manager.addLocationListener(self)

Objective C code snippet:

// Add location listener
[self.locationManager addLocationListener:self];

◆ getLocationId

- (int32_t) getLocationId

Method returns current location unique identifier.

Returns
current location unique identifier

Swift code snippet:

// Get current location ID
let currentLocationId = manager.getLocationId()
print("Current location ID: \‍(currentLocationId)")

Objective C code snippet:

// Get current location ID
int32_t currentLocationId = [self.locationManager getLocationId];
NSLog(@"Current location ID: %d", currentLocationId);

◆ removeLocationListener:

- (void) removeLocationListener: (nullable id< NCLocationListener >) listener

Method is used for removing previously added LocationListener class element.

Parameters
listenerСorresponding LocationListener class to remove.

Swift code snippet:

// Remove location listener
manager.removeLocationListener(self)

Objective C code snippet:

// Remove location listener
[self.locationManager removeLocationListener:self];

◆ setLocationId:

- (void) setLocationId: (int32_t) locationId

Method is used for setting current location, which will be downloaded from server or from storage, if it was downloaded before. Result will be handled by LocationListener.

Parameters
locationIdlocation id from CMS

Swift code snippet:

// Set location ID to load
manager.setLocationId(12345)

Objective C code snippet:

// Set location ID to load
[self.locationManager setLocationId:12345];

◆ setLocationUpdateInterval:

- (void) setLocationUpdateInterval: (int32_t) interval

Method is used to change interval in seconds check for new version from server Default: 300s.

Parameters
intervalupdate interval in seconds

Swift code snippet:

// Set location update interval (in seconds)
manager.setLocationUpdateInterval(600) // 10 minutes

Objective C code snippet:

// Set location update interval (in seconds)
[self.locationManager setLocationUpdateInterval:600]; // 10 minutes

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