Class Inventory
Describe the products that belong to the application and purchases made by the current user.
Inherited Members
Namespace: UnityEngine.UDP
Assembly: UDP.dll
Syntax
public class Inventory
Constructors
Inventory()
Declaration
public Inventory()
Methods
GetProductDictionary()
Retrieve products as a dictionary.
Declaration
public IDictionary<string, ProductInfo> GetProductDictionary()
Returns
Type | Description |
---|---|
IDictionary<string, ProductInfo> | dictionary of products |
GetProductInfo(string)
Retrieve the product information for the given productId.
Declaration
public ProductInfo GetProductInfo(string productId)
Parameters
Type | Name | Description |
---|---|---|
string | productId | Product ID |
Returns
Type | Description |
---|---|
ProductInfo | ProductInfo |
GetProductList()
Retrieve products as a list.
Declaration
public IList<ProductInfo> GetProductList()
Returns
Type | Description |
---|---|
IList<ProductInfo> | list of products |
GetPurchaseDictionary()
Retrieve purchases as a dictionary.
Declaration
public IDictionary<string, PurchaseInfo> GetPurchaseDictionary()
Returns
Type | Description |
---|---|
IDictionary<string, PurchaseInfo> | dictionary of purchases |
GetPurchaseInfo(string)
Retrieve PurchaseInfo for the given productId.
Declaration
public PurchaseInfo GetPurchaseInfo(string productId)
Parameters
Type | Name | Description |
---|---|---|
string | productId | Product ID |
Returns
Type | Description |
---|---|
PurchaseInfo | PurchaseInfo |
GetPurchaseList()
Retrieve purchases as a list.
Declaration
public List<PurchaseInfo> GetPurchaseList()
Returns
Type | Description |
---|---|
List<PurchaseInfo> | list of purchases |
HasProduct(string)
Check if a specific product exists.
Declaration
public bool HasProduct(string productId)
Parameters
Type | Name | Description |
---|---|---|
string | productId | Product ID |
Returns
Type | Description |
---|---|
bool | if product exists |
HasPurchase(string)
Check if any unconsumed purchase exists for given productId.
Declaration
public bool HasPurchase(string productId)
Parameters
Type | Name | Description |
---|---|---|
string | productId | Product ID |
Returns
Type | Description |
---|---|
bool | if purchase exists |