diff options
author | Alex Zolotarev <alex@maps.me> | 2015-08-06 21:48:10 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:00:14 +0300 |
commit | 0cd24f656e69356e35354558e39ca9bcda4d7ce3 (patch) | |
tree | 8d139d40c89ef7f45902bd6aadac836637a8bc6b | |
parent | cde41d9185fb109549b3719772042cdbcc56d725 (diff) |
[alohalytics][ios] Separate key constant.
-rw-r--r-- | 3party/Alohalytics/src/apple/alohalytics_objc.mm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/3party/Alohalytics/src/apple/alohalytics_objc.mm b/3party/Alohalytics/src/apple/alohalytics_objc.mm index 62eda99572..6adc88f34a 100644 --- a/3party/Alohalytics/src/apple/alohalytics_objc.mm +++ b/3party/Alohalytics/src/apple/alohalytics_objc.mm @@ -326,6 +326,8 @@ bool IsConnectionActive() { #endif // TARGET_OS_IPHONE } // namespace +// Keys for NSUserDefaults. +static NSString * const kInstalledVersionKey = @"AlohalyticsInstalledVersion"; @implementation Alohalytics + (void)setDebugMode:(BOOL)enable { @@ -368,7 +370,7 @@ bool IsConnectionActive() { // Calculate some basic statistics about installations/updates/launches. NSUserDefaults * userDataBase = [NSUserDefaults standardUserDefaults]; - NSString * installedVersion = [userDataBase objectForKey:@"AlohalyticsInstalledVersion"]; + NSString * installedVersion = [userDataBase objectForKey:kInstalledVersionKey]; BOOL shouldSendUpdatedSystemInformation = NO; if (installationId.second && isFirstLaunch && installedVersion == nil) { // Documents folder modification time can be interpreted as a "first app launch time" or an approx. "app install time". @@ -376,7 +378,7 @@ bool IsConnectionActive() { instance.LogEvent("$install", {{"CFBundleShortVersionString", [version UTF8String]}, {"documentsTimestampMillis", PathTimestampMillis([NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject])}, {"bundleTimestampMillis", PathTimestampMillis([bundle executablePath])}}); - [userDataBase setValue:version forKey:@"AlohalyticsInstalledVersion"]; + [userDataBase setValue:version forKey:kInstalledVersionKey]; [userDataBase synchronize]; shouldSendUpdatedSystemInformation = YES; } else { @@ -384,7 +386,7 @@ bool IsConnectionActive() { instance.LogEvent("$update", {{"CFBundleShortVersionString", [version UTF8String]}, {"documentsTimestampMillis", PathTimestampMillis([NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject])}, {"bundleTimestampMillis", PathTimestampMillis([bundle executablePath])}}); - [userDataBase setValue:version forKey:@"AlohalyticsInstalledVersion"]; + [userDataBase setValue:version forKey:kInstalledVersionKey]; [userDataBase synchronize]; shouldSendUpdatedSystemInformation = YES; } |