NavigationContextDelegate
Objective-C
@protocol NavigationContextDelegate <NSObject>
Swift
protocol NavigationContextDelegate : NSObjectProtocol
A set of delegate methods for navigation context objects.
-
Notifies the delegate with the new navigation status.
Declaration
Objective-C
- (void)navigationContext:(nonnull NavigationContext *)navigationContext route:(nonnull RouteObject *)route navigationStatusChanged:(NavigationStatus)status;
Swift
optional func navigationContext(_ navigationContext: NavigationContext, route: RouteObject, navigationStatusChanged status: NavigationStatus)
Parameters
navigationContext
The navigation context informing the delegate of this event.
route
The main route.
status
The navigation status.
-
Notifies the delegate that the navigation started.
Declaration
Objective-C
- (void)navigationContext:(nonnull NavigationContext *)navigationContext navigationStartedForRoute:(nonnull RouteObject *)route;
Swift
optional func navigationContext(_ navigationContext: NavigationContext, navigationStartedForRoute route: RouteObject)
Parameters
navigationContext
The navigation context informing the delegate of this event.
route
The main route.
-
Notifies the delegate that the navigation instruction is updated.
Declaration
Objective-C
- (void)navigationContext:(nonnull NavigationContext *)navigationContext navigationInstructionUpdatedForRoute:(nonnull RouteObject *)route updatedEvents:(int)events;
Swift
optional func navigationContext(_ navigationContext: NavigationContext, navigationInstructionUpdatedForRoute route: RouteObject, updatedEvents events: Int32)
Parameters
navigationContext
The navigation context informing the delegate of this event.
route
The main route.
updatedEvents
The turn update events. Please see NavigationInstructionUpdateEvent.
-
Notifies the delegate that the navigation route was updated.
Declaration
Objective-C
- (void)navigationContext:(nonnull NavigationContext *)navigationContext navigationRouteUpdated:(nonnull RouteObject *)route;
Swift
optional func navigationContext(_ navigationContext: NavigationContext, navigationRouteUpdated route: RouteObject)
Parameters
navigationContext
The navigation context informing the delegate of this event.
route
The main route.
-
Notifies the delegate when a way point on the route has been reached.
Declaration
Objective-C
- (void)navigationContext:(nonnull NavigationContext *)navigationContext route:(nonnull RouteObject *)route navigationWaypointReached:(nonnull LandmarkObject *)waypoint;
Swift
optional func navigationContext(_ navigationContext: NavigationContext, route: RouteObject, navigationWaypointReached waypoint: LandmarkObject)
Parameters
navigationContext
The navigation context informing the delegate of this event.
route
The main route.
waypoint
The way point reached.
-
Notifies the delegate when the destination have been reached.
Declaration
Objective-C
- (void)navigationContext:(nonnull NavigationContext *)navigationContext route:(nonnull RouteObject *)route navigationDestinationReached:(nonnull LandmarkObject *)waypoint;
Swift
optional func navigationContext(_ navigationContext: NavigationContext, route: RouteObject, navigationDestinationReached waypoint: LandmarkObject)
Parameters
navigationContext
The navigation context informing the delegate of this event.
route
The main route.
waypoint
The way point from destination.
-
Notifies the delegate that the navigation request finished with error.
Declaration
Objective-C
- (void)navigationContext:(nonnull NavigationContext *)navigationContext route:(nonnull RouteObject *)route navigationError:(NSInteger)code;
Swift
optional func navigationContext(_ navigationContext: NavigationContext, route: RouteObject, navigationError code: Int)
Parameters
navigationContext
The navigation context informing the delegate of this event.
route
The main route.
code
The error code.
-
Returns true if it is allowed to send a ‘navigationSound’ notification or not.
Declaration
Objective-C
- (BOOL)navigationContext:(nonnull NavigationContext *)navigationContext canPlayNavigationSoundForRoute:(nonnull RouteObject *)route;
Swift
optional func navigationContext(_ navigationContext: NavigationContext, canPlayNavigationSoundForRoute route: RouteObject) -> Bool
Parameters
navigationContext
The navigation context informing the delegate of this event.
route
The main route.
-
Notifies the delegate when a sound needs to be played.
Declaration
Objective-C
- (void)navigationContext:(nonnull NavigationContext *)navigationContext route:(nonnull RouteObject *)route navigationSound:(nonnull SoundObject *)sound;
Swift
optional func navigationContext(_ navigationContext: NavigationContext, route: RouteObject, navigationSound sound: SoundObject)
Parameters
navigationContext
The navigation context informing the delegate of this event.
route
The main route.
sound
The sound object.
-
Notifies the delegate when a better route was detected. The previous better route ( if exist ) must be considered automatically invalidated.
Declaration
Objective-C
- (void)navigationContext:(nonnull NavigationContext *)navigationContext onBetterRouteDetected:(nonnull RouteObject *)route travelTime:(NSInteger)travelTime delay:(NSInteger)delay timeGain:(NSInteger)timeGain;
Swift
optional func navigationContext(_ navigationContext: NavigationContext, onBetterRouteDetected route: RouteObject, travelTime: Int, delay: Int, timeGain: Int)
Parameters
navigationContext
The navigation context informing the delegate of this event.
route
The better route object.
travelTime
The better route travel time in seconds.
delay
The better route delay in seconds.
timeGain
The time gain from existing route in seconds. -1 means original route has roadblocks and time gain cannot be calculated. @details This notification is sent when a route is calculated with “avoid traffic” flag set to “true” ( setAvoidTraffic(true) ) and the engine detects a better route.
-
Notifies the delegate that the previously detected better route became invalid. This notification is sent when current position is no more on the previous calculated better route.
Declaration
Objective-C
- (void)navigationContext:(nonnull NavigationContext *)navigationContext onBetterRouteInvalidated:(BOOL)state;
Swift
optional func navigationContext(_ navigationContext: NavigationContext, onBetterRouteInvalidated state: Bool)
Parameters
navigationContext
The navigation context informing the delegate of this event.
state
The invalidation state.
-
Next intermediate destination skip intention detected.
Declaration
Objective-C
- (void)navigationContext:(nonnull NavigationContext *)navigationContext onSkipNextIntermediateDestinationDetected:(BOOL)state;
Swift
optional func navigationContext(_ navigationContext: NavigationContext, onSkipNextIntermediateDestinationDetected state: Bool)
Parameters
navigationContext
The navigation context informing the delegate of this event.
state
The detected state. @details This notification is sent the navigation engine detects user intention to skip the next intermediate destination