Skip to content

Commit 7913578

Browse files
[INTENG-19921] Fixed custom data not being properly included (#31)
* Fixed getContentFromEvent function * Fixed space * Update to logic * Updated version
1 parent a7971a9 commit 7913578

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

AdobeBranchExtension.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "AdobeBranchExtension"
3-
s.version = "3.0.0"
3+
s.version = "3.1.0"
44
s.summary = "The Branch extension for Adobe Cloud Platform on iOS."
55

66
s.description = <<-DESC
@@ -26,5 +26,5 @@ Pod::Spec.new do |s|
2626
s.dependency 'AEPLifecycle', '~> 4.2.0'
2727
s.dependency 'AEPIdentity', '~> 4.2.0'
2828
s.dependency 'AEPSignal', '~> 4.2.0'
29-
s.dependency 'BranchSDK', '~> 3.0.1'
29+
s.dependency 'BranchSDK', '~> 3.2.0'
3030
end

AdobeBranchExtension/Classes/AdobeBranchExtensionClass.m

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ - (void)handleEvent:(AEPEvent*)event {
198198
for (id<NSObject> key in dictionary_.keyEnumerator) {
199199
NSString *stringValue = BNCStringWithObject(dictionary_[key]);
200200
NSString *stringKey = BNCStringWithObject(key);
201-
if (stringKey.length && stringValue.length) dictionary[stringKey] = stringValue;
201+
if (stringKey.length && stringValue != nil) dictionary[stringKey] = stringValue;
202202
}
203203
return dictionary;
204204
}
@@ -283,16 +283,13 @@ - (void) trackEvent:(AEPEvent*)event {
283283
NSArray *parameters = [hitUrl componentsSeparatedByString:@"&"];
284284
NSMutableDictionary *content = [[NSMutableDictionary alloc] init];
285285

286-
NSArray *keys = @[@"category", @"currency", @"name", @"revenue", @"shipping", @"tax", @"coupon" ,@"sku", @"timestamp", @"transaction_id", @"affiliation", @"title", @"description", @"query"];
287-
288286
for (NSString *param in parameters) {
289-
for (NSString *key in keys) {
290-
if ([param containsString:[NSString stringWithFormat:@"%@=", key]]) {
291-
NSString *value = [[param componentsSeparatedByString:@"="] lastObject];
292-
value = [value stringByRemovingPercentEncoding];
293-
[content setObject:value forKey:key];
294-
break;
295-
}
287+
NSArray *keyValue = [param componentsSeparatedByString:@"="];
288+
if (keyValue.count == 2) {
289+
NSString *key = keyValue[0];
290+
NSString *value = keyValue[1];
291+
value = [value stringByRemovingPercentEncoding];
292+
[content setObject:value forKey:key];
296293
}
297294
}
298295

Examples/AdobeBranchExample/AdobeBranchExample/ProductListViewController.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
124124
@"timestamp": [NSDate date].description,
125125
@"category": @"Apparel & Accessories",
126126
@"sku": @"sku-bee-doo",
127+
@"adobeTestID" : @"12345",
128+
@"myCustomValue": @"Glasses",
129+
@"emptyValue": @""
127130
}];
128131
break;
129132
}}

0 commit comments

Comments
 (0)