summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Bounds <jesse@rebounds.net>2016-03-16 07:06:43 -0700
committerJesse Bounds <jesse@rebounds.net>2016-03-17 14:01:48 -0700
commitaa60d295346871bad0884238d13dcd9995d97151 (patch)
tree781e7e09bfb20ac3991c68a16744ffe185cf787e
parenta69df28d21fd7f4009103f601f7bc4bbace33308 (diff)
downloadqtlocation-mapboxgl-aa60d295346871bad0884238d13dcd9995d97151.tar.gz
[iOS] Use CFBundleIdentifier instead of CFBundleName in UA string
Although often recommended, CFBundleName is not guaranteed to exist in an app's configuration. As an identifier of telemetry data, even when it is present it can be inconsistent because of localization. CFBundleIdentifier, although possibly longer, will be consistent across locales and for the lifetime of an app in the App Store even if the app name changes in any locale.
-rw-r--r--platform/ios/src/MGLAPIClient.m2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/ios/src/MGLAPIClient.m b/platform/ios/src/MGLAPIClient.m
index 7a72496ac0..91bc074425 100644
--- a/platform/ios/src/MGLAPIClient.m
+++ b/platform/ios/src/MGLAPIClient.m
@@ -115,7 +115,7 @@ static NSString * const MGLAPIClientHTTPMethodPost = @"POST";
}
- (void)setupUserAgent {
- NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
+ NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"];
NSString *appVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
NSString *appBuildNumber = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
NSString *semanticVersion = [NSBundle mgl_frameworkInfoDictionary][@"MGLSemanticVersionString"];