ストアディスプレイとセクションを統合する
Last updated on February 4, 2026
注釈:本資料はAI技術を用いて翻訳されています。
概要
この記事では、Game SDKを通じてストアディスプレイとセクション情報を取得する方法について説明します。
前提条件
AccelByte Gaming Services管理ポータルでストアを作成している必要があります。詳細については、ストアを設定、構成、準備するを参照してください。
ストアディスプレイ情報を取得する
次の関数を使用して、ストアのストアディスプレイ情報を取得します。
- Unity
- C# Extend SDK
- Go Extend SDK
- Java Extend SDK
- Python Extend SDK
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
});
string storeId = "<your-store-id>";
string userId = "<user-id>";
var response = sdk.Platform.View.PublicListViewsOp
.SetStoreId(storeId)
.SetLanguage("<your-store-language>")
.Execute(sdk.Namespace, userId);
if (response != null)
{
//do something after store's views are retrieved
}
viewService := &platform.ViewService{
Client: factory.NewPlatformClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
namespace := "mygame"
userId := "myuserid"
language := "US"
storeId := "mystoreid"
input := &view.PublicListViewsParams{
Namespace: namespace,
UserID: userId,
Language: &language,
StoreID: &storeId,
}
result, err := viewService.PublicListViewsShort(input)
final View viewWrapper = new View(sdk);
String storeId = "<your-store-id>";
String userId = "<user-id>";
List<ViewInfo> response;
try {
response = viewWrapper.publicListViews(PublicListViews.builder()
.namespace("<namespace>")
.userId(userId)
.storeId(storeId)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something when successful
}
import accelbyte_py_sdk.api.platform as platform_service
result, error = platform_service.public_list_views(
user_id="********************************",
language="en-US",
store_id="YourStoreIdFromAdminPortal",
namespace=namespace, # optional, gets the value from the global instance if unspecified
sdk=sdk, # optional, gets the global instance if unspecified
)
if error:
exit(error)
ストアセクション情報を取得する
ストアディスプレイ情報を取得した後、ストアディスプレイのIDを取得し、それを使用して利用可能なアイテムを含むアクティブなセクションを取得できます。
次の関数を使用して、ストアのアクティブなセクションを取得します。
- Unity
- C# Extend SDK
- Go Extend SDK
- Java Extend SDK
- Python Extend SDK
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
});
string storeId = "<your-store-id>";
string userId = "<user-id>";
string viewId = "<your-store-view-id>"; //can be retrieved using PublicListViews
var response = sdk.Platform.Section.PublicListActiveSectionsOp
.SetStoreId(storeId)
.SetRegion("<your-store-region")
.SetLanguage("<your-store-language>")
.SetViewId(viewId)
.Execute(sdk.Namespace, userId);
if (response != null)
{
//do something after store's sections are retrieved
}
sectionService := &platform.SectionService{
Client: factory.NewPlatformClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
namespace := "mygame"
userId := "myuserid"
autoCalcEstimatedPrice := false
language := "en-US"
region := "US"
storeId := "mystoreid"
viewId := "myviewid"
input := §ion.PublicListActiveSectionsParams{
Namespace: namespace,
UserID: userId,
AutoCalcEstimatedPrice: &autoCalcEstimatedPrice,
Language: &language,
Region: ®ion,
StoreID: &storeId,
ViewID: &viewId,
}
result, err := sectionService.PublicListActiveSectionsShort(input)
final Section sectionWrapper = new Section(sdk);
String storeId = "<your-store-id>";
String userId = "<user-id>";
String viewId = "<your-store-view-id>"; //can be retrieved using PublicListViews
List<SectionInfo> response;
try {
response = sectionWrapper.publicListActiveSections(PublicListActiveSections.builder()
.namespace("<namespace>")
.userId(userId)
.storeId(storeId)
.region("<your-store-region")
.language("<your-store-language>")
.viewId(viewId)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something when successful
}
import accelbyte_py_sdk.api.platform as platform_service
result, error = platform_service.public_list_active_sections(
user_id="********************************",
language="en-US",
region="US",
store_id="YourStoreIdFromAdminPortal",
view_id="YourViewId",
namespace=namespace, # optional, gets the value from the global instance if unspecified
sdk=sdk, # optional, gets the global instance if unspecified
)
if error:
exit(error)