Multi Config
This documentation demonstrates how a multi-config setup can be used to send API requests using the mobile SDK.
Introduction
Android Multi Config is the mechanism by which mobile SDK users who have multiple Bazaarvoice client instances or ConfigHub deployment zones can issue a plurality of requests coming from any of their mobile apps. For example, consider a Bazaarvoice customer that has a Bazaarvoice client instance for their Brand experience and another for their retail store. Using Multi Config this customer could interact with both sets of configurations in the same app while keep them separate.
Default
The default way to send Conversations network requests is,
// Construct the client instance
BVConversationsClient client = new BVConversationsClient.Builder(BVSDK.getInstance())
.build();
// Construct a request
ReviewsRequest request = new ReviewsRequest.Builder("prodId", limit, offset)
.build();
// Send the request
client.prepareCall(request).loadAsync(callback);
This will send the requests with the clientId and Conversations API from the file generated from the installation page.
Multi
The multi-config way to send Conversations network requests is,
// Construct BVConfig objects for the clientId + apikey you want to send requests with
BVConfig configA = new BVConfig.Builder()
.clientId("clientA")
.apiKeyConversations("clientAKey")
.build();
BVConfig configB = new BVConfig.Builder()
.clientId("clientB")
.apiKeyConversations("clientBKey")
.build();
// Construct a client instance for each BVConfig object
BVConversationsClient clientWithConfigA = new BVConversationsClient.Builder(BVSDK.getInstance())
.bvConfig(configA)
.build();
BVConversationsClient clientWithConfigB = new BVConversationsClient.Builder(BVSDK.getInstance())
.bvConfig(configB)
.build();
// Construct a request
ReviewsRequest request = new ReviewsRequest.Builder("prodIdFromOneClientInventory", limit, offset)
.build();
// Send the request with the desired BVConversationsClient instance
clientWithConfigA.prepareCall(request).loadAsync(callback);
// or
clientWithConfigB.prepareCall(request).loadAsync(callback);
Updated 8 months ago