Class ExtensibleProductService
An abstract store service to extend an existing Product Service which will handle all of the basic IProductService implementations The main purpose of this is to allow a custom store to add implementations of extended features to this service. The calls to IProductService are kept virtual so that the derivations of the base store implementing them can be added to or overridden.
Implements
Inherited Members
Namespace: UnityEngine .Purchasing
Assembly: Unity.Purchasing.dll
Syntax
public abstract class ExtensibleProductService : IProductService
Constructors
ExtensibleProductService(IProductService)
Constructor to be used by derived classes
Declaration
protected ExtensibleProductService(IProductService baseProductService)
Parameters
Type | Name | Description |
---|---|---|
IProduct |
baseProductService | The base service implementation which implements IProductService |
Properties
Amazon
Amazon Specific Product Extensions
Declaration
public virtual IAmazonAppsExtendedProductService Amazon { get; }
Property Value
Type | Description |
---|---|
IAmazon |
Apple
Apple Specific Product Extensions
Declaration
public virtual IAppleStoreExtendedProductService Apple { get; }
Property Value
Type | Description |
---|---|
IApple |
Methods
AddProductsFetchFailedAction(Action<ProductFetchFailed>)
Add an action to be called when an attempt to fetch products has failed.
Declaration
public virtual void AddProductsFetchFailedAction(Action<ProductFetchFailed> failedAction)
Parameters
Type | Name | Description |
---|---|---|
Action<Product |
failedAction | The action to be added to the list of callbacks. |
AddProductsUpdatedAction(Action<List<Product>>)
Add an action to be called when products are successfully fetched.
Declaration
public virtual void AddProductsUpdatedAction(Action<List<Product>> updatedAction)
Parameters
Type | Name | Description |
---|---|---|
Action<List<Product>> | updatedAction | The action to be added to the list of callbacks. |
FetchProducts(List<ProductDefinition>, IRetryPolicy)
Fetches products matching the set of definitions passed as input.
Declaration
public virtual void FetchProducts(List<ProductDefinition> productDefinitions, IRetryPolicy retryPolicy)
Parameters
Type | Name | Description |
---|---|---|
List<Product |
productDefinitions | The definitions of the products to be fetched. |
IRetry |
retryPolicy | A custom retry policy that can be used for the fetch products query. If unspecified, an exponential backoff retry policy will be used. |
FetchProductsWithNoRetries(List<ProductDefinition>)
Fetches products matching the set of definitions passed as input.
Declaration
public virtual void FetchProductsWithNoRetries(List<ProductDefinition> productDefinitions)
Parameters
Type | Name | Description |
---|---|---|
List<Product |
productDefinitions | The definitions of the products to be fetched. |
GetProducts()
Gets the collection of all products that have been fetched successfully.
Declaration
public virtual ReadOnlyObservableCollection<Product> GetProducts()
Returns
Type | Description |
---|---|
Read |
An observable collection of the products already fetched. |
RemoveProductsFetchFailedAction(Action<ProductFetchFailed>)
Remove an action to be called when an attempt to fetch products has failed.
Declaration
public virtual void RemoveProductsFetchFailedAction(Action<ProductFetchFailed> failedAction)
Parameters
Type | Name | Description |
---|---|---|
Action<Product |
failedAction | The action to be removed from the list of callbacks. |
RemoveProductsUpdatedAction(Action<List<Product>>)
Remove an action to be called when products are successfully fetched.
Declaration
public virtual void RemoveProductsUpdatedAction(Action<List<Product>> updatedAction)
Parameters
Type | Name | Description |
---|---|---|
Action<List<Product>> | updatedAction | The action to be removed from the list of callbacks. |