1#import <Foundation/Foundation.h>
41@implementation NavigineSdkExample
62 NSLog(
@"Error: failed to get NavigineSdk instance");
68 NSLog(
@"Navigine SDK Version: %@", [
NCNavigineSdk getVersion]);
78 NSLog(
@"Relative Time: %lld", [
NCNavigineSdk getRelativeTime]);
93 NSLog(
@"SDK reset to initial state");
104 }
@catch (NSException *exception) {
105 NSLog(
@"SDK initialization error: %@", exception.reason);
117 NSLog(
@"LocationManager successfully initialized");
126 NSLog(
@"NavigationManager successfully initialized");
136 NSLog(
@"ZoneManager successfully initialized");
147 NSLog(
@"RouteManager successfully initialized");
158 NSLog(
@"AsyncRouteManager successfully initialized");
168 NSLog(
@"NotificationManager successfully initialized");
178 NSLog(
@"MeasurementManager successfully initialized");
187 NSLog(
@"LocationListManager successfully initialized");
195 NSLog(
@"StorageManager successfully initialized");
204 NSLog(
@"MqttSession successfully initialized");
214 NSLog(
@"=== Navigine SDK Information ===");
217 NSLog(
@"Relative Time: %lld", [
NCNavigineSdk getRelativeTime]);
218 NSLog(
@"LocationManager: %@",
self.
locationManager ?
@"available" :
@"unavailable");
219 NSLog(
@"NavigationManager: %@",
self.
navigationManager ?
@"available" :
@"unavailable");
220 NSLog(
@"ZoneManager: %@",
self.
zoneManager ?
@"available" :
@"unavailable");
221 NSLog(
@"RouteManager: %@",
self.
routeManager ?
@"available" :
@"unavailable");
222 NSLog(
@"AsyncRouteManager: %@",
self.
asyncRouteManager ?
@"available" :
@"unavailable");
223 NSLog(
@"NotificationManager: %@",
self.
notificationManager ?
@"available" :
@"unavailable");
224 NSLog(
@"MeasurementManager: %@",
self.
measurementManager ?
@"available" :
@"unavailable");
225 NSLog(
@"LocationListManager: %@",
self.
locationListManager ?
@"available" :
@"unavailable");
226 NSLog(
@"StorageManager: %@",
self.
storageManager ?
@"available" :
@"unavailable");
227 NSLog(
@"MqttSession: %@",
self.
mqttSession ?
@"available" :
@"unavailable");
234 NSLog(
@"=== Manager Usage Demonstration ===");
238 NSLog(
@"LocationManager ready for location operations");
244 NSLog(
@"NavigationManager ready for positioning");
250 NSLog(
@"ZoneManager ready for zone operations");
256 NSLog(
@"RouteManager ready for route building");
262 NSLog(
@"AsyncRouteManager ready for async route operations");
268 NSLog(
@"NotificationManager ready for notifications");
274 NSLog(
@"MeasurementManager ready for measurements");
280 NSLog(
@"LocationListManager ready for location list operations");
286 NSLog(
@"StorageManager ready for storage operations");
292 NSLog(
@"MqttSession ready for publishing position data via MQTT");
300 - (void)demonstrateObjectiveCFeatures {
301 NSLog(
@"=== Objective-C Features Demonstration ===");
304 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
306 dispatch_async(dispatch_get_main_queue(), ^{
307 NSLog(
@"Async operation completed");
312 [
self addObserver:
self forKeyPath:@"locationManager" options:NSKeyValueObservingOptionNew context:nil];
319 if ([
self respondsToSelector:selector]) {
320 [
self performSelector:selector];
327 - (void)observeValueForKeyPath:(NSString *)keyPath
329 change:(NSDictionary<NSKeyValueChangeKey,
id> *)change
330 context:(
void *)context {
331 if ([keyPath isEqualToString:
@"locationManager"]) {
332 NSLog(
@"LocationManager changed");
341 [
self demonstrateManagersUsage];
342 [
self demonstrateObjectiveCFeatures];
346 [
self removeObserver:
self forKeyPath:@"locationManager"];
354int main(
int argc,
const char * argv[]) {
357 [example runExample];