Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read API base URL from Info.plist #107

Open
1ec5 opened this issue May 21, 2017 · 0 comments
Open

Read API base URL from Info.plist #107

1ec5 opened this issue May 21, 2017 · 0 comments

Comments

@1ec5
Copy link
Contributor

1ec5 commented May 21, 2017

If no host is passed into Geocoder(accessToken:host:), the fallback hostname should be either api.mapbox.com or api.mapbox.cn depending on the value of MGLMapboxAPIBaseURL in Info.plist:

baseURLComponents.host = host ?? "api.mapbox.com"

This would be consistent with how we read the access token out of Info.plist:

let accessToken = accessToken ?? defaultAccessToken

This will make it easier for developers to keep their map and geocoder usage in sync, since Geocoder.shared would automatically pick up the API endpoint specified in Info.plist. Developers who need a different value for the geocoder can still override the API base URL when creating a separate Geocoder instance.

/cc @pdgoodman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant