-
Notifications
You must be signed in to change notification settings - Fork 48
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
Send appropriate user agent with geocoding requests #25
Comments
This is a bit more complicated than it used to be, now that we use the shared NSURLSession instead of a default NSURLSession. (There’s also an API to get the request URL so clients can perform the request themselves with a custom configuration.) The advantage to using the shared session is that client code doesn’t have to hold a strong reference to MBGeocoder or any other object in order for the callback to get called. |
When the Geocoder object sends a request, it sets the User-Agent HTTP header to a value of the form: SanDiego/1.2.3 MapboxGeocoder/0.5.0 iOS/9.3.0 (x86_64) This user agent string is based on the one used by the Mapbox iOS and OS X SDKs. Fixes #25.
When the Geocoder object sends a request, it sets the User-Agent HTTP header to a value of the form: SanDiego/1.2.3 MapboxGeocoder/0.5.0 iOS/9.3.0 (x86_64) This user agent string is based on the one used by the Mapbox iOS and OS X SDKs. Fixes #25.
Something more distinctive than the default
CFNetwork
.I'm not sure it makes sense to try to get the host app's name, but at the very least we can include
MBGeocoder
in the outgoing user agent./cc @1ec5
The text was updated successfully, but these errors were encountered: