From aa60d295346871bad0884238d13dcd9995d97151 Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Wed, 16 Mar 2016 07:06:43 -0700 Subject: [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. --- platform/ios/src/MGLAPIClient.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"]; -- cgit v1.2.1