Skip to content

Commit

Permalink
Merge pull request #24 from BranchMetrics/setdebug-update
Browse files Browse the repository at this point in the history
Setdebug update
  • Loading branch information
jsaleigh committed Oct 29, 2015
2 parents 1a54b43 + 44f7a87 commit 3100954
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "Web-SDK"]
path = Web-SDK
url = git@github.com:BranchMetrics/Web-SDK.git
url = git@github.com:BranchMetrics/Smart-App-Banner-Deep-Linking-Web-SDK.git
2 changes: 1 addition & 1 deletion Web-SDK
7 changes: 4 additions & 3 deletions cordova-src/android/BranchDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ private void getInstallData(JSONArray args, CallbackContext callbackContext) {
JSONObject installPost = new JSONObject();
try {
boolean debug = args.optBoolean(0);
Log.d("BranchDevice", "GetInstallData debug value is " + debug);
Log.d("BranchDevice", "getInstallData debug value is " + debug);
int isReferrable = args.optInt(1, -1);
Log.d("BranchDevice", "GetInstallData isReferrable value is " + isReferrable);
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 Expand Up @@ -138,7 +139,7 @@ private void getOpenData(JSONArray args, CallbackContext callbackContext) {
JSONObject openPost = new JSONObject();
try {
int isReferrable = args.optInt(0, -1);
Log.d("BranchDevice", "GetInstallData isReferrable value is " + isReferrable);
Log.d("BranchDevice", "getOpenData isReferrable value is " + isReferrable);
if (isReferrable < 0) {
openPost.put("is_referrable", 0);
} else {
Expand Down
5 changes: 3 additions & 2 deletions cordova-src/ios/BNCDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ - (NSDictionary*)parseURLParams:(NSString *)query {

- (void)getInstallData:(CDVInvokedUrlCommand *)command {
BOOL debug = [[command argumentAtIndex:0 withDefault:[NSNumber numberWithBool:NO]] boolValue];
int isReferrable = [[command argumentAtIndex:0 withDefault:[NSNumber numberWithInt:-1]] intValue];
int isReferrable = [[command argumentAtIndex:1 withDefault:[NSNumber numberWithInt:-1]] intValue];

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
2 changes: 2 additions & 0 deletions cordova-testbed/init.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

cordova plugin add org.apache.cordova.console de.appplant.cordova.plugin.email-composer
# This fixes 404 errors in ajax calls on the android platform with newer versions of Cordova
cordova plugin add cordova-plugin-whitelist
cordova plugin add ../ --link
cordova platform add ios android
Loading

0 comments on commit 3100954

Please sign in to comment.