diff --git a/ios/BranchContentMetadata+RNBranch.m b/ios/BranchContentMetadata+RNBranch.m index e36e5c188..412f4953d 100644 --- a/ios/BranchContentMetadata+RNBranch.m +++ b/ios/BranchContentMetadata+RNBranch.m @@ -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], diff --git a/ios/RNBranch.m b/ios/RNBranch.m index 5552a9c8f..2a5e762a7 100644 --- a/ios/RNBranch.m +++ b/ios/RNBranch.m @@ -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); } diff --git a/src/branchUniversalObject.js b/src/branchUniversalObject.js index 2f52ad9cd..547c9352f 100644 --- a/src/branchUniversalObject.js +++ b/src/branchUniversalObject.js @@ -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 = {}) {