Skip to main content

Integrate Store Display and Section

Last updated on April 5, 2024

Overview

This article walks you through how to retrieve Store Display and Section information through the Game SDK.

Prerequisite

You have created stores in the AccelByte Gaming Services Admin Portal. For more information, see Set up, configure, and prepare a store.

Retrieve Store Display information

Use the following function to get the Store Display information of a store:

string storeId = "YourStoreIdFromAdminPortal";
string storeLanguage = "US";
ViewInfo[] views;

StoreDisplay storeDisplay = AccelByteSDK.GetClientRegistry().GetApi().GetStoreDisplayService();

storeDisplay.GetAllViews(storeId, storeLanguage, result =>
{
if (result.IsError)
{
// Your logic to handle errors in GetAllViews
// ...
Debug.Log($"Error GetAllViews, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}

views = result.Value;
// Your logic to run after GetAllViews is successful
});

Retrieve Store Section information

After retrieving the Store Display information, you can get the ID of the Store display and use that to get the active section that contains available items.

Use the following function to get the active section of a store:

string storeId = "YourStoreIdFromAdminPortal";
string viewId = "YourViewId";
string storeLanguage = "en-US";
string storeRegion = "US";
SectionInfo[] viewSections;

StoreDisplay storeDisplay = AccelByteSDK.GetClientRegistry().GetApi().GetStoreDisplayService();

storeDisplay.ListActiveSectionContents(storeId, viewId, storeRegion, storeLanguage, result =>
{
if (result.IsError)
{
// Your logic to handle errors in ListActiveSectionContents
// ...
Debug.Log($"Error ListActiveSectionContents, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}

viewSections = result.Value;
// Your logic to run after ListActiveSectionContents is successful
});