Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Events when user close or finish mapbox navigation on ios

$
0
0

I am launching a mapbox navigation through a bridge (in react native) I would like to know how to catch event when user close the navigation view or stop navigation mapboxnavigation version :0.35.0

here is my navigation code:

 if (CLLocationManager.locationServicesEnabled()) {
        locationManager.startUpdatingLocation() // start location manager
      }

      let origin = Waypoint(coordinate: CLLocationCoordinate2D(latitude: number2, longitude: number), name: "Origin")
      let destination = Waypoint(coordinate: CLLocationCoordinate2D(latitude: number4, longitude: number3), name: "Destination")
      let options = NavigationRouteOptions(waypoints: [origin, destination])

      Directions.shared.calculate(options) { (waypoints, routes, error) in
        guard let route = routes?.first else { return }

        let viewController = NavigationViewController(for: route)
        let appDelegate = UIApplication.shared.delegate
        appDelegate!.window!!.rootViewController!.present(viewController, animated: true, completion: nil)
      }


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>