Skip to content

Store Service

The Store Service is a simple data service used to fetch IStoreRewardData, which are used to purchase items in your game using virtual currency. For real-world money purchases, see the IPurchasingService.

Setting up your Store

When setting up your store UI, you can use the Store Service to fetch items for your store and categorize them by reward type. For example:

// get all store rewards granting currency
List<IStoreReward> currencyRewards = _storeService.GetAllStoreCurrencyRewards().ToList();
IStoreReward[] currencyRewardsByCost = currencyRewards
    .OrderBy(storeReward => storeReward.StoreRewardData.Cost)
    .ToArray();

To let the player purchase an item from your store, your UI will need to call Buy. You should first make sure that the player has met the required criteria (for example, has enough currency) before attempting to call Buy.