Turn-by-turn navigation stops after app spent 20 minutes in background
Hi,
I've downloaded mapbox-navigation-ios and built it according to instructions via carthage. Then I've added a routeControllerProgressDidChange function and added it as observer to NotificationCenter. This works fine after starting a real navigation. But only as long as the iPhone display is on and the app in the foreground.
Once I put the app in background I can see via the console that my progressDidChange function is still being called regularly for about 20 minutes, then it stops indefinitely. Only after opening the app again the function is being called. I know Apple restricts background activities, but they are allowed for actual navigations. Background modes "Audio etc" and "Location Updates" are ticked, just like in the current master branch.
So why does my build stop navigating after 20 minutes in background? Have I missed something or is this always the case? Can't really imagine this because navigations often take much longer than 20 min and you don't always want the display to be on and the app in the foreground.
I've used these versions in my cartfile: binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" ~> 4.3 github "mapbox/MapboxDirections.swift" ~> 0.22.0
iPhone 5S, iOS 11.4.1 XCode 9.4.1
Thanks in advance! Frank
I've updated everything and the problem remains the same. The support mentioned it could be a hardware issue, but I can't really imagine in which way. Unfortunately, I don't have any other iPhone handy.
iPhone 5S, iOS 12 XCode 10.0
Location simulation is continuously and moving via GPX file loaded in XCode. Does anyboady have an idea?
Thank you for your report. Have you tried navigating without the GPX-based location simulator? Are you using one of the built-in GPX routes or a custom? Are you getting re-routed throughout the simulation? Is the application terminating or the progress just stops?
Try adding a breakpoint or log statement in AppDelegate.applicationWillTerminate(_:).
If you're using a custom gpx-file, please post it here.
Does the progress gets interrupted if you use the SimulatedLocationManager?
Also, keep an eye on the memory usage. If it keeps growing, the app will eventually get terminated.
I've just tried simulating a 4 hours long route in the background and I'm currently at 2 hours, progress still updating.
Thanks for your quick and helpful reply. Just wanted to let you know that indeed GPS simulation was part of the issue. With a long self-generated GPX file the navigation stays active. We running more tests, but for the moment we're doing fine.
Regards Frank
On Thu, 20 Sep 2018 at 22:48, Fredrik Karlsson [email protected] wrote:
Thank you for your report. Have you tried navigating without the GPX-based location simulator? Are you using one of the built-in GPX routes or a custom? Are you getting re-routed throughout the simulation? Is the application terminating or the progress just stops?
Try adding a breakpoint or log statement in AppDelegate.applicationWillTerminate(_:). If you're using a custom gpx-file, please post it here.
Does the progress gets interrupted if you use the SimulatedLocationManager ?
I've just tried simulating a 4 hours long route in the background and I'm currently at 2 hours, progress still updating.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mapbox/mapbox-navigation-ios/issues/1713#issuecomment-423169993, or mute the thread https://github.com/notifications/unsubscribe-auth/AiCzgI5toFhDsnbccsRCSO6NgdQ92B1Hks5uc464gaJpZM4Wruvx .