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

Include application and operating system name and version in user agent string #4012

Merged
merged 1 commit into from Apr 17, 2016

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Feb 18, 2016

The user agent string for all non-telemetry requests in the iOS and OS X SDKs now conforms to the following format:

MyApp/0.1.2 Mapbox/3.4.5 MapboxGL/6.7.8 (deadfeed) iOS Simulator/9.0.1 (x86_64)
^ app       ^ sdk        ^ core                    ^ os                 ^ arch

This file only links against the cross-platform CoreFoundation and Foundation frameworks, not the platform-specific AppKit or UIKit frameworks, so the options for identifying the operating system and device are fairly limited. (I didn’t want to go through such great lengths to include all those details.)

Fixes #3997.

@kkaefer for review. @boundsj, can you confirm that this beefed-up user agent string will be compatible with the style API and dashboard?

@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS labels Feb 18, 2016
@1ec5 1ec5 self-assigned this Feb 18, 2016
@1ec5 1ec5 added this to the ios-v3.2.0 milestone Feb 18, 2016
@kkaefer
Copy link
Contributor

kkaefer commented Feb 18, 2016

Can we use TargetConditionals.h to know more about the platform we're building for? So instead of Darwin, we'd use iOS, iOS Simulator, or Mac OS X.

@kkaefer
Copy link
Contributor

kkaefer commented Feb 18, 2016

Ah sorry, the last commit does that.

Can we cache the value of the the User Agent string composition?

@1ec5
Copy link
Contributor Author

1ec5 commented Feb 18, 2016

@kkaefer, do you know why the version.hpp include would fail only on clean builds for iOS (but not OS X)?

@mikemorris
Copy link
Contributor

do you know why the version.hpp include would fail only on clean builds for iOS (but not OS X)?

Because it's generated and the iOS build might be missing this step? https://github.com/mapbox/mapbox-gl-native/blob/master/gyp/version.gypi

@kkaefer
Copy link
Contributor

kkaefer commented Feb 18, 2016

since we can detect it from the architecture

what are we going to do when Apple introduces an x86_64 iOS device?

@1ec5
Copy link
Contributor Author

1ec5 commented Feb 18, 2016

what are we going to do when Apple introduces an x86_64 iOS device?

We’re going to build an SDK for it and update this logic. 😄

@1ec5 1ec5 added the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Feb 18, 2016
@1ec5
Copy link
Contributor Author

1ec5 commented Feb 18, 2016

Because it's generated and the iOS build might be missing this step? https://github.com/mapbox/mapbox-gl-native/blob/master/gyp/version.gypi

@mikemorris, including a version dependency should be enough, right?

@1ec5 1ec5 removed the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Apr 17, 2016
@1ec5 1ec5 merged commit f936295 into master Apr 17, 2016
@1ec5 1ec5 deleted the 1ec5-user-agent-3997 branch April 17, 2016 07:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants