mapbox / mapbox/mapbox-speech-swift

Read API base URL from Info.plist

Open
#14 1 comment 0 reactions 1 assignee Claimed by @m-stephen View on GitHub
improvement
Dominant language
Swift
Stars
46
Forks
16
PR merge metrics
No merged PRs in 30d

Description

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

https://github.com/mapbox/mapbox-speech-swift/blob/b0163852eb6e3efd36effc9893e1eab10932036a/MapboxSpeech/MapboxSpeech.swift#L96

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

https://github.com/mapbox/mapbox-speech-swift/blob/b0163852eb6e3efd36effc9893e1eab10932036a/MapboxSpeech/MapboxSpeech.swift#L89

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

/ref mapbox/MapboxGeocoder.swift#107
/cc @m-stephen @bsudekum

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.