mapbox/mapbox-navigation-ios

2.14Version of bad experience

ytx0574 opened this issue · 6 comments

  1. When simulated navigation is used, the bearing and pitch of CameraOptions are abnormal, and the page does not slide and jumps frequently.
  2. The memory usage exceeds 500 MB
  3. Can adjust the token setting? My project requires users to register mapbox to provide services by themselves, which cannot be specified in info.plist
    video: https://youtube.com/shorts/LdBYU2f5H6A

Hi @ytx0574

Thank you for reporting the issue. Could you please provide the sample project to reproduce the problems with the camera and memory usage? Some kind of memory leak might cause it.

Please elaborate on what you mean by adjusting the token settings. The token can be provided in the runtime by passing credentials to the NavigationService initializer, the Directions initializer

❌,❌,❌, When I start the simulated navigation, I repeat the same simulated navigation again when I finish, and after doing this many times, the following callback does not match the direction/name in the topbanner in the NavigationViewController.

func navigationViewController(_ navigationViewController: NavigationViewController, didUpdate progress: RouteProgress, with location: CLLocation, rawLocation: CLLocation)

Hi @ytx0574

Thank you for reporting the issue. Could you please provide the sample project to reproduce the problems with the camera and memory usage? Some kind of memory leak might cause it.

Please elaborate on what you mean by adjusting the token settings. The token can be provided in the runtime by passing credentials to the NavigationService initializer, the Directions initializer

  1. I want the token to be configured in code, not in info.plist. Our users need to register mapbox themselves
  2. The problem of camera, reproduced in the video. https://youtube.com/shorts/LdBYU2f5H6A The video begins with it swinging from side to side, followed by the swing of the hammer
  1. I want the token to be configured in code, not in info.plist. Our users need to register mapbox themselves

Yes, there is a way to configure the token in the code. As I mentioned in my message above, you can pass the token to the NavigationService initializer and the Directions initializer.
You'll also need to add a stub value to theInfo.plist, you can take a look at the Info.plist in the example and use the same stub value. This stub value won't be used if you configure Directions and NavigationService in the code.

The configuration code might look like this:

        let accessToken = "YOUR_TOKEN"
        let directions = Directions(credentials: .init(accessToken: accessToken))
        NavigationSettings.shared.initialize(with: .init(directions: directions))
        let routingProvider = MapboxRoutingProvider(settings: .shared)
....
        let navigationService = MapboxNavigationService(indexedRouteResponse: indexedRouteResponse,
                                                        credentials: .init(accessToken: accessToken))
  1. The problem of camera, reproduced in the video. https://youtube.com/shorts/LdBYU2f5H6A The video begins with it swinging from side to side, followed by the swing of the hammer

@ytx0574 Please share your code for starting and stopping the navigation or a sample project to reproduce the issue. We were not able to reproduce the problem. How do you stop the previous navigation before starting a new one?
Are you sure you not storing the instances of MapboxNavigationService from the previous navigation session?

  1. The problem of camera, reproduced in the video. https://youtube.com/shorts/LdBYU2f5H6A The video begins with it swinging from side to side, followed by the swing of the hammer

@ytx0574 Please share your code for starting and stopping the navigation or a sample project to reproduce the issue. We were not able to reproduce the problem. How do you stop the previous navigation before starting a new one? Are you sure you not storing the instances of MapboxNavigationService from the previous navigation session?

image

I make sure that I do not have MapboxNavigationService, and I release the slef.navigationViewController directly after the navigation