Skip to content

Read API base URL from Info.plist #14

@1ec5

Description

@1ec5

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:

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, 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions