Skip to content

Commit

Permalink
Random hardware ID for iOS when debug flag is set for #14
Browse files Browse the repository at this point in the history
Added debug_set value to return value during a fresh install
  • Loading branch information
John Saleigh committed Oct 29, 2015
1 parent bfeb8f4 commit acb8473
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions cordova-src/android/BranchDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ private void getInstallData(JSONArray args, CallbackContext callbackContext) {
int isReferrable = args.optInt(1, -1);
Log.d("BranchDevice", "getInstallData isReferrable value is " + isReferrable);
String idStr = getUniqueID(debug);
installPost.put("debug_set", debug);
if (!idStr.equals(BLANK)) {
installPost.put("hardware_id", idStr);
installPost.put("is_hardware_id_real", hasRealHardwareId());
Expand Down
3 changes: 2 additions & 1 deletion cordova-src/ios/BNCDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ - (void)getInstallData:(CDVInvokedUrlCommand *)command {
NSMutableDictionary *post = [[NSMutableDictionary alloc] init];
BOOL isRealHardwareId;
NSString *hardwareId = [BNCDevice getUniqueHardwareId:&isRealHardwareId andIsDebug:debug];
[post setObject:[NSNumber numberWithBool:debug] forKey:@"debug_set"];
if (hardwareId) {
[post setObject:hardwareId forKey:@"hardware_id"];
[post setObject:[NSNumber numberWithBool:isRealHardwareId] forKey:@"is_hardware_id_real"];
Expand Down Expand Up @@ -125,7 +126,7 @@ + (NSString *)getUniqueHardwareId:(BOOL *)isReal andIsDebug:(BOOL)debug {
uid = [[UIDevice currentDevice].identifierForVendor UUIDString];
}

if (!uid) {
if (!uid || debug) {
uid = [[NSUUID UUID] UUIDString];
*isReal = NO;
}
Expand Down

0 comments on commit acb8473

Please sign in to comment.