Skip to content

Commit

Permalink
Merge pull request #306 from BranchMetrics/rating-average
Browse files Browse the repository at this point in the history
Field mapping
  • Loading branch information
jdee authored Dec 15, 2017
2 parents 9773769 + ded7ad9 commit 5512d3e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ios/BranchContentMetadata+RNBranch.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ @implementation BranchContentMetadata(RNBranch)
@"productCategory": [RNBranchProperty propertyWithSetterSelector:@selector(setProductCategory:) type:NSString.class],
@"productVariant": [RNBranchProperty propertyWithSetterSelector:@selector(setProductVariant:) type:NSString.class],
@"condition": [RNBranchProperty propertyWithSetterSelector:@selector(setCondition:) type:NSString.class],
@"ratingAverage": [RNBranchProperty propertyWithSetterSelector:@selector(setRatingAverage:) type:NSNumber.class],
@"ratingAverage": [RNBranchProperty propertyWithSetterSelector:@selector(setRatingAverageWithNumber:) type:NSNumber.class],
@"ratingCount": [RNBranchProperty propertyWithSetterSelector:@selector(setRatingCountWithNumber:) type:NSNumber.class],
@"ratingMax": [RNBranchProperty propertyWithSetterSelector:@selector(setRatingMaxWithNumber:) type:NSNumber.class],
@"addressStreet": [RNBranchProperty propertyWithSetterSelector:@selector(setAddressStreet:) type:NSString.class],
Expand Down
8 changes: 8 additions & 0 deletions ios/RNBranch.m
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,14 @@ - (BranchUniversalObject *)findUniversalObjectWithIdent:(NSString *)ident reject
}

event.contentItems = buos;
if ([eventName isEqualToString:BranchStandardEventViewItem] && params.count == 0) {
for (BranchUniversalObject *buo in buos) {
if (!buo.locallyIndex) continue;
// for now at least, pending possible changes to the native SDK
[buo listOnSpotlight];
}
}

[event logEvent];
resolve(NSNull.null);
}
Expand Down
3 changes: 3 additions & 0 deletions src/branchUniversalObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export default async function createBranchUniversalObject(identifier, options =
},
userCompletedAction(event, state = {}) {
console.info('[Branch] userCompletedAction is deprecated. Please use logEvent or the BranchEvent class instead.')
if (event == RNBranch.REGISTER_VIEW_EVENT) {
return this.logEvent(BranchEvent.ViewItem, { customData: state })
}
return this._tryFunction(RNBranch.userCompletedActionOnUniversalObject, event, state)
},
logEvent(eventName, params = {}) {
Expand Down

0 comments on commit 5512d3e

Please sign in to comment.