mapbox / mapbox/mapbox-navigation-ios
Offline Routing tiles 402 error
@MaximAlien is already working on this.
Since Jul 25, 2022.
- Dominant language
- Swift
- Stars
- 918
- Forks
- 326
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 3
Description
### Mapbox Navigation SDK version
2.2.1
### Steps to reproduce
When calling Directions.shared.downloadTiles we are getting a 402 response.
`▿ Optional
- some : { URL: https://api.mapbox.com/route-tiles/v1/-118.46003707025038,33.56680755615234%3B-117.97809295654301,34.33335820197513?version=2022_07_09-03_00_00&access_token=*** } { Status Code: 402, Headers {
"Access-Control-Allow-Origin" = (
"*"
);
Connection = (
"keep-alive"
);
"Content-Length" = (
223
);
"Content-Type" = (
"application/json; charset=utf-8"
);
Date = (
"Tue, 12 Jul 2022 20:47:39 GMT"
);
Vary = (
"Accept-Encoding"
);
Via = (
"1.1 1c5a7e2dbc29e2ce87f40dbbc168a96c.cloudfront.net (CloudFront)"
);
"X-Amz-Cf-Id" = (
"Cmhvo61chMXrkCTpqDVGg4h4Y1qUY3Y8o8kkl_7xg1sj5ZOysUwl0A=="
);
"X-Amz-Cf-Pop" = (
"LAX50-P2"
);
"X-Cache" = (
"Error from cloudfront"
);
"X-Content-Type-Options" = (
nosniff
);
"X-Rate-Limit-Interval" = (
60
);
"X-Rate-Limit-Limit" = (
1000
);
"X-Rate-Limit-Reset" = (
1657658919
);
"x-mapbox-request-id" = (
"Cmhvo61chMXrkCTpqDVGg4h4Y1qUY3Y8o8kkl_7xg1sj5ZOysUwl0A=="
);
} }`
Defined scopes for our token are as follows:

[OfflineMaps.zip](https://github.com/mapbox/mapbox-navigation-ios/files/9096764/OfflineMaps.zip)
### Expected behavior
When calling Directions.shared.downloadTiles we are expecting a 200 response and should be able to call Directions api while offline.
### Actual behavior
When calling Directions.shared.downloadTiles we are getting a 402 response and we are not able to call Directions api while offline to fetch a route.
### Is this a one-time issue or a repeatable issue?
repeatable
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.