Skip to main content
RichRelevance

Regions

Regions let you use different product attributes such as list price, sale price, catalog names, and availability for groups of users. Typically, these users are from one geographic area or region-for example, an international retailer could set up one region for each country where they do business. Regions can also be used more abstractly so long as the basic requirements are met.

For more details about regions, you can read to the Regions reference.

You can add the following line after your builder initialization but before sendRequest.

[builder setRegionID:@"1337"];

The following example will add regional information to a Home request:

RCHRequestPlacement *placement = [[RCHRequestPlacement alloc] initWithPageType:RCHPlacementPageTypeHome name:@"<placement name>"];
    
RCHPlacementRecsBuilder *builder = [RCHSDK builderForRecsWithPlacement:placement];
// Add region information
[builder setRegionID:@"1337"];

 __block RCHRecommendedProduct *product;
[[RCHSDK defaultClient] sendRequest:[builder build] success:^(id responseObject) {
    RCHPlacementsResult *result = responseObject;
    RCHPlacement *placement = result.placements[0];
    product = placement.recommendedProducts[0];
} failure:^(id responseObject, NSError *error){
    // Use this code block to handle any errors that may occur while loading recommendations.
    NSLog(@"Error encountered: %@", error);
}];