Class IAPListener
An invisible GUI component for initializing Unity IAP and processing lifecycle events.
Inherited Members
Namespace: UnityEngine .Purchasing
Assembly: Unity.Purchasing.Codeless.dll
Syntax
[AddComponentMenu("In-App Purchasing/IAP Listener")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.purchasing@latest")]
public class IAPListener : MonoBehaviour
Fields
automaticallyConfirmTransaction
Consume successful purchases immediately.
Declaration
[Tooltip("Automatically confirm the transaction immediately after a successful purchase.")]
public bool automaticallyConfirmTransaction
Field Value
Type | Description |
---|---|
bool |
See Also
dontDestroyOnLoad
Preserve this GameObject when a new scene is loaded.
Declaration
[Tooltip("Preserve this GameObject when a new scene is loaded.")]
public bool dontDestroyOnLoad
Field Value
Type | Description |
---|---|
bool |
See Also
onOrderConfirmed
Event fired after updating a confirmed order.
Declaration
[Tooltip("Event fired after updating a confirmed order.")]
public IAPListener.OnOrderConfirmedEvent onOrderConfirmed
Field Value
Type | Description |
---|---|
IAPListener.On |
See Also
onOrderDeferred
Event fired after deferring to purchase an order.
Declaration
[Tooltip("Event fired after the payment of a purchase was delayed or postponed.")]
public IAPListener.OnOrderDeferredEvent onOrderDeferred
Field Value
Type | Description |
---|---|
IAPListener.On |
See Also
onOrderPending
Event fired after updating a pending order.
Declaration
[Tooltip("Event fired after updating a pending order.")]
public IAPListener.OnOrderPendingEvent onOrderPending
Field Value
Type | Description |
---|---|
IAPListener.On |
See Also
onProductsFetchFailed
Event fired after failing to fetch products.
Declaration
[Tooltip("Event fired after failing to fetch products.")]
public IAPListener.OnProductsFetchFailedEvent onProductsFetchFailed
Field Value
Type | Description |
---|---|
IAPListener.On |
See Also
onProductsFetched
Event fired after fetching products.
Declaration
[Tooltip("Event fired after fetching products.")]
public IAPListener.OnProductsFetchedEvent onProductsFetched
Field Value
Type | Description |
---|---|
IAPListener.On |
See Also
onPurchaseFailed
Event fired after failing to purchase an order.
Declaration
[Tooltip("Event fired after failing to purchase an order.")]
public IAPListener.OnPurchaseFailedEvent onPurchaseFailed
Field Value
Type | Description |
---|---|
IAPListener.On |
See Also
onPurchasesFetchFailure
Event fired after failing to fetch purchases.
Declaration
[Tooltip("Event fired after failing to fetch purchases.")]
public IAPListener.OnPurchasesFetchFailureEvent onPurchasesFetchFailure
Field Value
Type | Description |
---|---|
IAPListener.On |
See Also
onPurchasesFetched
Event fired after fetching purchases.
Declaration
[Tooltip("Event fired after fetching purchases.")]
public IAPListener.OnPurchasesFetchedEvent onPurchasesFetched
Field Value
Type | Description |
---|---|
IAPListener.On |
See Also
Methods
OnOrderConfirmed(ConfirmedOrder)
Invoked when updating a confirmed order.
Declaration
public void OnOrderConfirmed(ConfirmedOrder confirmedOrder)
Parameters
Type | Name | Description |
---|---|---|
Confirmed |
confirmedOrder | The |
See Also
OnOrderDeferred(DeferredOrder)
Invoked on deferring to purchase an order.
Declaration
public void OnOrderDeferred(DeferredOrder deferredOrder)
Parameters
Type | Name | Description |
---|---|---|
Deferred |
deferredOrder | The |
See Also
OnOrderPending(PendingOrder)
Invoked when updating a pending order
Declaration
public void OnOrderPending(PendingOrder pendingOrder)
Parameters
Type | Name | Description |
---|---|---|
Pending |
pendingOrder | The |
See Also
OnProductsFetchFailed(ProductFetchFailed)
Invoked when failing to fetch products
Declaration
public void OnProductsFetchFailed(ProductFetchFailed productFetchFailed)
Parameters
Type | Name | Description |
---|---|---|
Product |
productFetchFailed | The |
See Also
OnProductsFetched(List<Product>)
Invoked when fetching products
Declaration
public void OnProductsFetched(List<Product> products)
Parameters
See Also
OnPurchaseFailed(FailedOrder)
Invoked on failing to purchase an order.
Declaration
public void OnPurchaseFailed(FailedOrder failedOrder)
Parameters
Type | Name | Description |
---|---|---|
Failed |
failedOrder | The |
See Also
OnPurchasesFetchFailure(PurchasesFetchFailureDescription)
Invoked when failing to fetch purchases
Declaration
public void OnPurchasesFetchFailure(PurchasesFetchFailureDescription purchasesFetchFailureDescription)
Parameters
Type | Name | Description |
---|---|---|
Purchases |
purchasesFetchFailureDescription | The |
See Also
OnPurchasesFetched(Orders)
Invoked when fetching purchases
Declaration
public void OnPurchasesFetched(Orders orders)
Parameters
Type | Name | Description |
---|---|---|
Orders | orders | The fetched purchase |