Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Configurable API hostname #6346

Closed
1ec5 opened this issue Sep 15, 2016 · 2 comments · Fixed by #6709
Closed

Configurable API hostname #6346

1ec5 opened this issue Sep 15, 2016 · 2 comments · Fixed by #6709
Assignees
Labels
feature iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Sep 15, 2016

#6309 is adding the ability to customize the meaning of mapbox: URLs to mbgl. We should offer a convenient way for the developer to modify the API hostname. Two options:

  1. Add a hostname property to MGLOfflineStorage whose setter calls mbgl::DefaultFileSource::setAPIBaseURL().
  2. Have MGLOfflineStorage call mbgl::DefaultFileSource::setAPIBaseURL() automatically based on an MGLMapboxAPIHostname user default.
  3. Same as (2), but as an Info.plist entry.

I prefer either (2) or (3) because MGLOfflineStorage is largely asynchronous and therefore easy to use incorrectly.

It’d be nice to call this option a “hostname” for consistency with the Mapbox Swift libraries’ existing API hostname options. However, “base URL” would be more correct since it looks like you can provide an arbitrary path and scheme in addition to the hostname. MGLAPIClient already has support for a MGLTelemetryTestServerURL user default that defaults to MGLAPIClientBaseURL, so I guess we can follow that naming scheme.

/cc @boundsj @tobrun

@1ec5 1ec5 added feature iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS labels Sep 15, 2016
@1ec5 1ec5 added this to the ios-v3.4.0 milestone Sep 15, 2016
@1ec5
Copy link
Contributor Author

1ec5 commented Sep 15, 2016

Also, if we end up making this a user default, we should provide constants for api.mapbox.com and any alternative hostnames we might need to support publicly.

@incanus
Copy link
Contributor

incanus commented Sep 16, 2016

Thoughts on moving this off of the milestone though @1ec5?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants