Skip to content

Commit

Permalink
feat: add jsonResponse to attribution in web bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
uerceg committed Jan 28, 2025
1 parent 2d168bd commit 58112d4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Adjust/ADJAttribution.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ - (NSDictionary *)dictionary {
if (self.costCurrency != nil) {
[responseDataDic setObject:self.costCurrency forKey:@"costCurrency"];
}
if (self.jsonResponse != nil) {
[responseDataDic setObject:self.jsonResponse forKey:@"jsonResponse"];
}

return responseDataDic;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
//static NSString * controlUrl = @"ws://127.0.0.1:1987";

// device
static NSString * urlOverwrite = @"http://192.168.178.81:8080";
static NSString * controlUrl = @"ws://192.168.178.81:1987";
static NSString * urlOverwrite = @"http://192.168.86.82:8080";
static NSString * controlUrl = @"ws://192.168.86.82:1987";

@interface TestLibraryBridge : NSObject<AdjustCommandDelegate>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//var urlOverwrite = 'http://127.0.0.1:8080';
//var controlUrl = 'ws://127.0.0.1:1987';
// device
var urlOverwrite = 'http://192.168.178.81:8080';
var controlUrl = 'ws://192.168.178.81:1987';
var urlOverwrite = 'http://192.168.86.82:8080';
var controlUrl = 'ws://192.168.86.82:1987';

// local reference of the command executor
// originally it was this.adjustCommandExecutor of TestLibraryBridge var
Expand Down Expand Up @@ -335,6 +335,12 @@ AdjustCommandExecutor.prototype.config = function(params) {
addInfoToSend('cost_type', attribution.costType);
addInfoToSend('cost_amount', attribution.costAmount);
addInfoToSend('cost_currency', attribution.costCurrency);
const jsonResponseWithoutFbInstallReferrer = { ...attribution.jsonResponse };
if (jsonResponseWithoutFbInstallReferrer.cost_amount !== undefined) {
jsonResponseWithoutFbInstallReferrer.cost_amount = parseFloat(jsonResponseWithoutFbInstallReferrer.cost_amount).toFixed(2);
}
delete jsonResponseWithoutFbInstallReferrer.fb_install_referrer;
addInfoToSend('json_response', JSON.stringify(jsonResponseWithoutFbInstallReferrer));
sendInfoToServer(extraPath);
}
);
Expand Down Expand Up @@ -647,6 +653,12 @@ AdjustCommandExecutor.prototype.attributionGetter = function(params) {
addInfoToSend('cost_type', attribution.costType);
addInfoToSend('cost_amount', attribution.costAmount);
addInfoToSend('cost_currency', attribution.costCurrency);
const jsonResponseWithoutFbInstallReferrer = { ...attribution.jsonResponse };
if (jsonResponseWithoutFbInstallReferrer.cost_amount !== undefined) {
jsonResponseWithoutFbInstallReferrer.cost_amount = parseFloat(jsonResponseWithoutFbInstallReferrer.cost_amount).toFixed(2);
}
delete jsonResponseWithoutFbInstallReferrer.fb_install_referrer;
addInfoToSend('json_response', JSON.stringify(jsonResponseWithoutFbInstallReferrer));
sendInfoToServer(extraPath);
});
}
Expand Down

0 comments on commit 58112d4

Please sign in to comment.