I have several stores in the game. These stores have a list of bundles. I need for each store to select the bundles that belong to it. The documentation doesn't provide examples in C#, so I'm asking you to provide one. Only Economy V2 API!
I have several stores in the game. These stores have a list of bundles. I need for each store to select the bundles that belong to it. The documentation doesn't provide examples in C#, so I'm asking you to provide one. Only Economy V2 API!
You could refer to the code below to get all bundles in your stores.
void GetBundlesInStores()
{
PlayFabEconomyAPI.SearchItems(new SearchItemsRequest
{
//get store list
Filter = "type eq 'store'"
}, re1 =>
{
foreach (var store in re1.Items)
{
Debug.Log("StoreId:" + store.Id);
PlayFabEconomyAPI.SearchItems(new SearchItemsRequest
{
//filter bundles in store
Filter = "type eq 'bundle'",
Store=new StoreReference { Id=store.Id },
}, re2 =>
{
foreach (var bundle in re2.Items)
{
Debug.Log("BundleId: " + bundle.Id);
}
}, er2 =>
{
Debug.Log(er2.GenerateErrorReport());
});
}
}, er1 =>
{
Debug.Log(er1.GenerateErrorReport());
});
}
It may also be beneficial to look into the new Catalog Views feature we announced at GDC this year. It allows you to take a simple query like this one and cache the results to a blob in the CDN for quick and easy download at startup. Take a look.
https://learn.microsoft.com/en-us/gaming/playfab/features/economy-v2/catalog/catalog-views
2 People are following this question.