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

Commit

Permalink
[iOS] Use CFBundleIdentifier instead of CFBundleName in UA string
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
boundsj committed Mar 17, 2016
1 parent a69df28 commit aa60d29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion platform/ios/src/MGLAPIClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ - (void)loadCertificate:(NSData **)certificate withResource:(NSString *)resource
}

- (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"];
Expand Down

0 comments on commit aa60d29

Please sign in to comment.