/
Route Sharing (v2.1.x – 2.2.x)

Route Sharing (v2.1.x – 2.2.x)

The NMRouteSharingManager class in the SDK is responsible for managing the sharing of routes. This includes starting and stopping the route sharing process and checking if the route sharing is currently active.

An instance of the NMRouteSharingManager can be retrieved using the NMSdkproperty routeSharingManager.

The NMRouteSharingManager class provides the following functionality:

  • Starting route sharing using the startRouteSharingWithCredentials:listener: method.

  • Stopping route sharing using the stopRouteSharing method.

  • Checking if route sharing is active using the isRouteSharingStarted method.

Listening for route sharing events

The NMRouteSharingListener is an abstract class that handles route sharing events. Implement this listener to receive notifications about the status of the route sharing.

  • - (void)onRouteSharingStartedWithUrl:(nonnull NSString *)urlString: Called once route sharing is started. The urlString parameter will contain a link to the webpage where the shared route can be viewed.

  • - (void)onRouteSharingFailedWithError:(NMRouteSharingError)error: Called if route sharing fails.

  • - (void)onRouteSharingStopped: Called once route sharing is stopped.

Example:

NMRouteSharingManager *routeSharingManager = pathwayProSDK.routeSharingManager; NMRouteSharingMapAccessCredentials *credentials = [[NMRouteSharingMapAccessCredentials alloc] initWithAccountId:@"" emailId:@"" password:@"" serviceId:@1234 cdnServiceId:@4321]; [routeSharingManager startRouteSharingWithCredentials:credentials listener: self]; // ... // Stop route sharing when necessary [routeSharingManager stopRouteSharing]; // ... // Check if route sharing is active BOOL isRouteSharingStarted = routeSharingManager.isRouteSharingStarted; NSLog(@"isRouteSharingStarted: %@", isRouteSharingStarted ? @"YES" : @"NO");

 

Related content

Route sharing
Route sharing
More like this
Routing (v2.1.x – 2.2.x)
Routing (v2.1.x – 2.2.x)
More like this
Routing (v2.1.x - Android)
Routing (v2.1.x - Android)
More like this
Rerouting (v2.0.x)
Rerouting (v2.0.x)
More like this
Route Navigation (v2.1.x – 2.2.x)
Route Navigation (v2.1.x – 2.2.x)
More like this
Navigation Service
Navigation Service
More like this