Skip to content

Commit 664a148

Browse files
authored
Merge pull request #12 from BranchMetrics/INTENG-9765-control-params-must-be-in-data
Inteng 9765 control params must be in data
2 parents 4d9664c + fda0856 commit 664a148

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

Branch/BranchLinkProperties.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ - (NSDictionary*) dictionary {
6060
addInteger(matchDuration, ~duration);
6161
addInteger(linkType, ~type);
6262

63-
[dictionary addEntriesFromDictionary:self.controlParams];
63+
//[dictionary addEntriesFromDictionary:self.controlParams];
6464

6565
return dictionary;
6666
}

Branch/BranchMainClass.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,13 @@ - (void) branchShortLinkWithContent:(BranchUniversalObject*)content
700700

701701
NSMutableDictionary*dictionary = [NSMutableDictionary new];
702702
[dictionary addEntriesFromDictionary:linkProperties.dictionary];
703-
dictionary[@"data"] = content.dictionary;
703+
704+
// Control params must also be at the data level
705+
NSMutableDictionary *data = [NSMutableDictionary new];
706+
[data addEntriesFromDictionary:linkProperties.controlParams];
707+
[data addEntriesFromDictionary:content.dictionary];
708+
dictionary[@"data"] = data;
709+
704710
[self.networkAPIService appendV1APIParametersWithDictionary:dictionary];
705711
[self.networkAPIService postOperationForAPIServiceName:@"v1/url"
706712
dictionary:dictionary

Examples/TestBed-macOS/TestBed-macOS/APPViewController.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ - (BranchUniversalObject*) createUniversalObject {
264264
- (BranchLinkProperties*) createLinkProperties {
265265
NSString *feature = @"Sharing Feature";
266266
NSString *channel = @"Distribution Channel";
267-
// NSString *desktop_url = @"http://branch.io";
267+
NSString *desktop_url = @"http://branch.io";
268268
// NSString *ios_url = @"https://dev.branch.io/getting-started/sdk-integration-guide/guide/ios/";
269269

270270
BranchLinkProperties *linkProperties = [[BranchLinkProperties alloc] init];
@@ -274,6 +274,9 @@ - (BranchLinkProperties*) createLinkProperties {
274274
linkProperties.stage = @"stage four";
275275
linkProperties.campaign = @"some campaign";
276276
linkProperties.matchDuration = 18000;
277+
278+
linkProperties.controlParams[@"$desktop_url"] = desktop_url;
279+
277280
// TODO: Control params:
278281
// [linkProperties addControlParam:@"$desktop_url" withValue: desktop_url];
279282
// [linkProperties addControlParam:@"$ios_url" withValue: ios_url];

0 commit comments

Comments
 (0)