Skip to content

Commit a11e97b

Browse files
committed
Merge pull request #348 from BranchMetrics/ios-vendor-id
send vendor id with each request
2 parents 6db7ccf + dd44cfb commit a11e97b

File tree

7 files changed

+16
-0
lines changed

7 files changed

+16
-0
lines changed

Branch-SDK/Branch-SDK/BNCDeviceInfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
@property (nonatomic, strong) NSString *hardwareId;
2020
@property (nonatomic, strong) NSString *hardwareIdType;
2121
@property (nonatomic) BOOL isRealHardwareId;
22+
@property (nonatomic, strong) NSString *vendorId;
2223
@property (nonatomic, strong) NSString *brandName;
2324
@property (nonatomic, strong) NSString *modelName;
2425
@property (nonatomic, strong) NSString *osName;

Branch-SDK/Branch-SDK/BNCDeviceInfo.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ - (id)init {
3838
self.hardwareIdType = hardwareIdType;
3939
}
4040

41+
self.vendorId = [BNCSystemObserver getVendorId:preferenceHelper.isDebug];
4142
self.brandName = [BNCSystemObserver getBrand];
4243
self.modelName = [BNCSystemObserver getModel];
4344
self.osName = [BNCSystemObserver getOS];

Branch-SDK/Branch-SDK/BNCServerInterface.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ - (void)updateDeviceInfoToMutableDictionary:(NSMutableDictionary *)dict {
260260
dict[BRANCH_REQUEST_KEY_IS_HARDWARE_ID_REAL] = @(deviceInfo.isRealHardwareId);
261261
}
262262

263+
[self safeSetValue:deviceInfo.vendorId forKey:BRANCH_REQUEST_KEY_IOS_VENDOR_ID onDict:dict];
263264
[self safeSetValue:deviceInfo.brandName forKey:BRANCH_REQUEST_KEY_BRAND onDict:dict];
264265
[self safeSetValue:deviceInfo.modelName forKey:BRANCH_REQUEST_KEY_MODEL onDict:dict];
265266
[self safeSetValue:deviceInfo.osName forKey:BRANCH_REQUEST_KEY_OS onDict:dict];

Branch-SDK/Branch-SDK/BNCSystemObserver.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
@interface BNCSystemObserver : NSObject
1212

1313
+ (NSString *)getUniqueHardwareId:(BOOL *)isReal isDebug:(BOOL)debug andType:(NSString **)type;
14+
+ (NSString *)getVendorId:(BOOL)debug;
1415
+ (NSString *)getDefaultUriScheme;
1516
+ (NSString *)getAppVersion;
1617
+ (NSString *)getBundleID;

Branch-SDK/Branch-SDK/BNCSystemObserver.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ + (NSString *)getUniqueHardwareId:(BOOL *)isReal isDebug:(BOOL)debug andType:(NS
4444
return uid;
4545
}
4646

47+
+ (NSString *)getVendorId:(BOOL)debug {
48+
NSString *vendorId = nil;
49+
50+
if (!debug && NSClassFromString(@"UIDevice")) {
51+
vendorId = [[UIDevice currentDevice].identifierForVendor UUIDString];
52+
}
53+
54+
return vendorId;
55+
}
56+
4757
+ (BOOL)adTrackingSafe {
4858
Class ASIdentifierManagerClass = NSClassFromString(@"ASIdentifierManager");
4959
if (ASIdentifierManagerClass) {

Branch-SDK/Branch-SDK/BranchConstants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ extern NSString * const BRANCH_REQUEST_KEY_APP_LIST;
4040
extern NSString * const BRANCH_REQUEST_KEY_HARDWARE_ID;
4141
extern NSString * const BRANCH_REQUEST_KEY_HARDWARE_ID_TYPE;
4242
extern NSString * const BRANCH_REQUEST_KEY_IS_HARDWARE_ID_REAL;
43+
extern NSString * const BRANCH_REQUEST_KEY_IOS_VENDOR_ID;
4344
extern NSString * const BRANCH_REQUEST_KEY_AD_TRACKING_ENABLED;
4445
extern NSString * const BRANCH_REQUEST_KEY_IS_REFERRABLE;
4546
extern NSString * const BRANCH_REQUEST_KEY_DEBUG;

Branch-SDK/Branch-SDK/BranchConstants.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
NSString * const BRANCH_REQUEST_KEY_HARDWARE_ID = @"hardware_id";
4141
NSString * const BRANCH_REQUEST_KEY_HARDWARE_ID_TYPE = @"hardware_id_type";
4242
NSString * const BRANCH_REQUEST_KEY_IS_HARDWARE_ID_REAL = @"is_hardware_id_real";
43+
NSString * const BRANCH_REQUEST_KEY_IOS_VENDOR_ID = @"ios_vendor_id";
4344
NSString * const BRANCH_REQUEST_KEY_AD_TRACKING_ENABLED = @"ad_tracking_enabled";
4445
NSString * const BRANCH_REQUEST_KEY_IS_REFERRABLE = @"is_referrable";
4546
NSString * const BRANCH_REQUEST_KEY_DEBUG = @"debug";

0 commit comments

Comments
 (0)