Rerouting with IOS Runtime not working.

1387
6
Jump to solution
02-12-2021 01:17 PM
JayBowman12
New Contributor II

I have a IOS application using Runtime SDK 100.10. This is a typical navigation with rerouting. I have sample code working with a simulated location data source. Where I created 2 routes, my intended route and my simulated route. I can traverse along the simulated route and when it diverges from the intended route I get a reroute event and a new route is displayed to the intended destination (great) re-routing works. 

The issue is how do I move to production? When I comment out my simulation code and enable my production code and do an actual driving test. I get my initial route, then as I drive everything is good. But when I go off route I DON'T get a reroute completed event. Looking at our ARCGIS server logs I see route request coming in after my first successful route. The subsequent route request don't have any stops in the route parameters. So the routing services is not returning a new route or error my GPS continues to track my location and the app continues to send route request to the server because the routetracker knows I'm off route.  

 

 // MARK: For production use system location data source
 let routeTrackerLocationDataSource = AGSRouteTrackerLocationDataSource(routeTracker: routeTracker)
                     
// Set location display data source.
mapView.locationDisplay.dataSource = routeTrackerLocationDataSource

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Nicholas-Furness
Esri Regular Contributor

Hi. Sorry for the slow response.

You should write to a local file and then extract it once you've done your test. You could write it to the user's documents folder somewhere and then extract the file. You can get the documents folder with this swift code:

let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!

And you can add the Application supports iTunes file sharing property to your Info.plist file and set it to YES.

2021-02-17_10-57-15.png

That way you can browse to the file using a Finder window.

Of course, if you want to, your app can always upload that file somewhere if you prefer, but Runtime will only write to the file on local storage.

Also, be sure not to include this debug logging in your production code by default. It has a performance impact. Hope that helps.

View solution in original post

6 Replies
Nicholas-Furness
Esri Regular Contributor

Hi Jay.

Is that your production code in the code snippet you provided above? I don't see any simulation there, so I think it might be. If it's not, you should not change the location data source but continue to use the AGSRouteTrackerLocationDataSource in production. But I think you are doing that.

Assuming this is your production code, I'd need to understand more. Are your simulations and driving tests hitting the same routing service? Is there any difference in how you've wired up the AGSRouteTrackerDelegate? I assume you're seeing a routeTrackerRerouteDidStart delegate event?

You could also try using AGSRequestConfiguration.global().debugLogRequests and debugLogFileURL to get some insight into the requests that are being made by Runtime.

0 Kudos
JayBowman12
New Contributor II

Thanks for the reply. 

I'm trying to setup the request logging. In my view controller init() I configured the logging.

AGSRequestConfiguration.global().debugLogRequests = true

AGSRequestConfiguration.global().debugLogFileURL = URL(fileURLWithPath: "https://my server/remotelogs/remotedebug.md")

I setup IIS to all read,write.modify rights to this folder for both IIS_IUSRS and  the app pool in NTFS security. But I'm get a console log in xcode when trying to test the logging "Could not create file at /https:/arc7.myserver.com/remotelogs/remotedebug.md, make sure you have appropriate permissions. 

I also added the md extension to my IIS mime types. What else do i need to do to get this to work.

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Hi. Sorry for the slow response.

You should write to a local file and then extract it once you've done your test. You could write it to the user's documents folder somewhere and then extract the file. You can get the documents folder with this swift code:

let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!

And you can add the Application supports iTunes file sharing property to your Info.plist file and set it to YES.

2021-02-17_10-57-15.png

That way you can browse to the file using a Finder window.

Of course, if you want to, your app can always upload that file somewhere if you prefer, but Runtime will only write to the file on local storage.

Also, be sure not to include this debug logging in your production code by default. It has a performance impact. Hope that helps.

JayBowman12
New Contributor II

I was able to get the arcgis debug log and sent it to Esri support. Thanks for your help. Still working on resolving the issue of why the rerouting is not working when doing an actual on the road driving test.

0 Kudos
JayBowman12
New Contributor II

How would I enable the same http request logging on Android? I see the getGlobaleRequestConfiguration(), but I don't see any way to turn on debugging at this point. 

 

 

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Unfortunately that capability isn't available in the Android SDK. You would have to capture traffic with Charles Proxy or Fiddler or something along those lines.

0 Kudos