1#import <Foundation/Foundation.h>
34- (void)demonstrateManagersUsage;
39@implementation NavigineSdkExample
60 NSLog(
@"Error: failed to get NavigineSdk instance");
66 NSLog(
@"Navigine SDK Version: %@", [
NCNavigineSdk getVersion]);
76 NSLog(
@"Relative Time: %lld", [
NCNavigineSdk getRelativeTime]);
92 }
@catch (NSException *exception) {
93 NSLog(
@"SDK initialization error: %@", exception.reason);
105 NSLog(
@"LocationManager successfully initialized");
114 NSLog(
@"NavigationManager successfully initialized");
124 NSLog(
@"ZoneManager successfully initialized");
135 NSLog(
@"RouteManager successfully initialized");
146 NSLog(
@"AsyncRouteManager successfully initialized");
156 NSLog(
@"NotificationManager successfully initialized");
166 NSLog(
@"MeasurementManager successfully initialized");
175 NSLog(
@"LocationListManager successfully initialized");
183 NSLog(
@"StorageManager successfully initialized");
191 - (void)printSdkInfo {
192 NSLog(
@"=== Navigine SDK Information ===");
195 NSLog(
@"Relative Time: %lld", [
NCNavigineSdk getRelativeTime]);
196 NSLog(
@"LocationManager: %@",
self.
locationManager ?
@"available" :
@"unavailable");
197 NSLog(
@"NavigationManager: %@",
self.
navigationManager ?
@"available" :
@"unavailable");
198 NSLog(
@"ZoneManager: %@",
self.
zoneManager ?
@"available" :
@"unavailable");
199 NSLog(
@"RouteManager: %@",
self.
routeManager ?
@"available" :
@"unavailable");
200 NSLog(
@"AsyncRouteManager: %@",
self.
asyncRouteManager ?
@"available" :
@"unavailable");
201 NSLog(
@"NotificationManager: %@",
self.
notificationManager ?
@"available" :
@"unavailable");
202 NSLog(
@"MeasurementManager: %@",
self.
measurementManager ?
@"available" :
@"unavailable");
203 NSLog(
@"LocationListManager: %@",
self.
locationListManager ?
@"available" :
@"unavailable");
204 NSLog(
@"StorageManager: %@",
self.
storageManager ?
@"available" :
@"unavailable");
210 - (void)demonstrateManagersUsage {
211 NSLog(
@"=== Manager Usage Demonstration ===");
215 NSLog(
@"LocationManager ready for location operations");
221 NSLog(
@"NavigationManager ready for positioning");
227 NSLog(
@"ZoneManager ready for zone operations");
233 NSLog(
@"RouteManager ready for route building");
239 NSLog(
@"AsyncRouteManager ready for async route operations");
245 NSLog(
@"NotificationManager ready for notifications");
251 NSLog(
@"MeasurementManager ready for measurements");
257 NSLog(
@"LocationListManager ready for location list operations");
263 NSLog(
@"StorageManager ready for storage operations");
271 - (void)demonstrateObjectiveCFeatures {
272 NSLog(
@"=== Objective-C Features Demonstration ===");
275 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
277 dispatch_async(dispatch_get_main_queue(), ^{
278 NSLog(
@"Async operation completed");
283 [
self addObserver:
self forKeyPath:@"locationManager" options:NSKeyValueObservingOptionNew context:nil];
289 SEL selector =
@selector(printSdkInfo);
290 if ([
self respondsToSelector:selector]) {
291 [
self performSelector:selector];
298 - (void)observeValueForKeyPath:(NSString *)keyPath
300 change:(NSDictionary<NSKeyValueChangeKey,
id> *)change
301 context:(
void *)context {
302 if ([keyPath isEqualToString:
@"locationManager"]) {
303 NSLog(
@"LocationManager changed");
312 [
self demonstrateManagersUsage];
313 [
self demonstrateObjectiveCFeatures];
317 [
self removeObserver:
self forKeyPath:@"locationManager"];
325int main(
int argc,
const char * argv[]) {
328 [example runExample];