Manos Chorianopoulos

add new registration parameters with trackers

......@@ -5725,14 +5725,46 @@ CGFloat DistanceBetweenTwoPoints(CGPoint point1,CGPoint point2)
old_identifier_for_vendor = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
}
NSDictionary *parameters = @{@"advertising_identifier": [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString],
@"old_identifier_for_vendor": old_identifier_for_vendor,
@"new_identifier_for_vendor": [[[UIDevice currentDevice] identifierForVendor] UUIDString],
@"unique-device-id": [[[UIDevice currentDevice] identifierForVendor] UUIDString],
@"vendor": @"apple",
@"platform": @"ios",
@"os_version": [[UIDevice currentDevice] systemVersion],
@"channel": @"mobile"};
// OLD parameters
// NSDictionary *parameters = @{@"advertising_identifier": [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString],
// @"old_identifier_for_vendor": old_identifier_for_vendor,
// @"new_identifier_for_vendor": [[[UIDevice currentDevice] identifierForVendor] UUIDString],
// @"unique-device-id": [[[UIDevice currentDevice] identifierForVendor] UUIDString],
// @"vendor": @"apple",
// @"platform": @"ios",
// @"os_version": [[UIDevice currentDevice] systemVersion],
// @"channel": @"mobile"};
// NEW parameters
NSMutableDictionary *parameters = [[NSMutableDictionary alloc] init];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults boolForKey:@"trackersEnabled"] == YES) {
[parameters setValue:@"ios" forKey:@"platform"];
[parameters setValue:@"Apple" forKey:@"manufacturer"];
if ([[UIDevice currentDevice] platform].length != 0) {
[parameters setValue:[[UIDevice currentDevice] platform] forKey:@"ios_device_model"];
}
[parameters setValue:[[UIDevice currentDevice] systemVersion] forKey:@"os_version"];
//Application Data Hack
NSBundle *mainBundle = [NSBundle mainBundle];
NSString *CFBundleShortVersionString = [mainBundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
if (CFBundleShortVersionString.length != 0) {
[parameters setValue:CFBundleShortVersionString forKey:@"app_version"];
}
}
[parameters setValue:@"apple" forKey:@"vendor"];
[parameters setValue:[[[UIDevice currentDevice] identifierForVendor] UUIDString] forKey:@"unique_device_id"];
WLLOG(@"Registration parameters: %@", parameters);
// NSData *jsonData = [NSJSONSerialization dataWithJSONObject:postDictionary options:0 error:NULL];
......