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]);
94 }
@catch (NSException *exception) {
95 NSLog(
@"SDK initialization error: %@", exception.reason);
107 NSLog(
@"LocationManager successfully initialized");
116 NSLog(
@"NavigationManager successfully initialized");
126 NSLog(
@"ZoneManager successfully initialized");
137 NSLog(
@"RouteManager successfully initialized");
148 NSLog(
@"AsyncRouteManager successfully initialized");
158 NSLog(
@"NotificationManager successfully initialized");
168 NSLog(
@"MeasurementManager successfully initialized");
177 NSLog(
@"LocationListManager successfully initialized");
185 NSLog(
@"StorageManager successfully initialized");
194 NSLog(
@"MqttSession successfully initialized");
204 NSLog(
@"=== Navigine SDK Information ===");
207 NSLog(
@"Relative Time: %lld", [
NCNavigineSdk getRelativeTime]);
208 NSLog(
@"LocationManager: %@",
self.
locationManager ?
@"available" :
@"unavailable");
209 NSLog(
@"NavigationManager: %@",
self.
navigationManager ?
@"available" :
@"unavailable");
210 NSLog(
@"ZoneManager: %@",
self.
zoneManager ?
@"available" :
@"unavailable");
211 NSLog(
@"RouteManager: %@",
self.
routeManager ?
@"available" :
@"unavailable");
212 NSLog(
@"AsyncRouteManager: %@",
self.
asyncRouteManager ?
@"available" :
@"unavailable");
213 NSLog(
@"NotificationManager: %@",
self.
notificationManager ?
@"available" :
@"unavailable");
214 NSLog(
@"MeasurementManager: %@",
self.
measurementManager ?
@"available" :
@"unavailable");
215 NSLog(
@"LocationListManager: %@",
self.
locationListManager ?
@"available" :
@"unavailable");
216 NSLog(
@"StorageManager: %@",
self.
storageManager ?
@"available" :
@"unavailable");
217 NSLog(
@"MqttSession: %@",
self.
mqttSession ?
@"available" :
@"unavailable");
224 NSLog(
@"=== Manager Usage Demonstration ===");
228 NSLog(
@"LocationManager ready for location operations");
234 NSLog(
@"NavigationManager ready for positioning");
240 NSLog(
@"ZoneManager ready for zone operations");
246 NSLog(
@"RouteManager ready for route building");
252 NSLog(
@"AsyncRouteManager ready for async route operations");
258 NSLog(
@"NotificationManager ready for notifications");
264 NSLog(
@"MeasurementManager ready for measurements");
270 NSLog(
@"LocationListManager ready for location list operations");
276 NSLog(
@"StorageManager ready for storage operations");
282 NSLog(
@"MqttSession ready for publishing position data via MQTT");
290 - (void)demonstrateObjectiveCFeatures {
291 NSLog(
@"=== Objective-C Features Demonstration ===");
294 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
296 dispatch_async(dispatch_get_main_queue(), ^{
297 NSLog(
@"Async operation completed");
302 [
self addObserver:
self forKeyPath:@"locationManager" options:NSKeyValueObservingOptionNew context:nil];
309 if ([
self respondsToSelector:selector]) {
310 [
self performSelector:selector];
317 - (void)observeValueForKeyPath:(NSString *)keyPath
319 change:(NSDictionary<NSKeyValueChangeKey,
id> *)change
320 context:(
void *)context {
321 if ([keyPath isEqualToString:
@"locationManager"]) {
322 NSLog(
@"LocationManager changed");
331 [
self demonstrateManagersUsage];
332 [
self demonstrateObjectiveCFeatures];
336 [
self removeObserver:
self forKeyPath:@"locationManager"];
344int main(
int argc,
const char * argv[]) {
347 [example runExample];