diff options
author | Ilya Grechuhin <i.grechuhin@mapswithme.com> | 2015-07-30 16:59:01 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:58:18 +0300 |
commit | 6a5be9479245377ce5f9d7bfbe219b8935afd341 (patch) | |
tree | 6d08c46463880d62cddc14672ac7ba41d13e7773 /iphone/Maps/Classes/MapsAppDelegate.mm | |
parent | b81b9b214f7277c9e79925960ab77ff8fc0b0f0a (diff) |
[ios] Added custom fields to Push filtering.
Diffstat (limited to 'iphone/Maps/Classes/MapsAppDelegate.mm')
-rw-r--r-- | iphone/Maps/Classes/MapsAppDelegate.mm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index 385a66db6c..38caf2d9ec 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -42,6 +42,11 @@ static NSString * const kOldWatchUserEventKey = @"OldWatchUser"; static NSString * const kUDWatchEventAlreadyTracked = @"WatchEventAlreadyTracked"; static NSString * const kPushDeviceTokenLogEvent = @"iOSPushDeviceToken"; static NSString * const kIOSIDFA = @"IFA"; +static NSString * const kBundleVersion = @"BundleVersion"; + +extern string const kCountryCodeKey; +extern string const kUniqueIdKey; +extern string const kLanguageKey; /// Adds needed localized strings to C++ code /// @TODO Refactor localization mechanism to make it simpler @@ -133,11 +138,18 @@ void InitLocalizedStrings() - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - PFInstallation * const currentInstallation = [PFInstallation currentInstallation]; + PFInstallation * currentInstallation = [PFInstallation currentInstallation]; [currentInstallation setDeviceTokenFromData:deviceToken]; - NSUUID const * const advertisingId = [AppInfo sharedInfo].advertisingId; + AppInfo * appInfo = [AppInfo sharedInfo]; + NSUUID * advertisingId = appInfo.advertisingId; if (advertisingId) [currentInstallation setObject:advertisingId.UUIDString forKey:kIOSIDFA]; + [currentInstallation setObject:appInfo.countryCode forKey:@(kCountryCodeKey.c_str())]; + [currentInstallation setObject:appInfo.uniqueId forKey:@(kUniqueIdKey.c_str())]; + NSString * languageId = appInfo.languageId; + if (languageId) + [currentInstallation setObject:languageId forKey:@(kLanguageKey.c_str())]; + [currentInstallation setObject:appInfo.bundleVersion forKey:kBundleVersion]; [currentInstallation saveInBackground]; [Alohalytics logEvent:kPushDeviceTokenLogEvent withValue:currentInstallation.deviceToken]; |