Class IAPListener
An invisible GUI component for initializing Unity IAP and processing lifecycle events.
Inherited Members
Namespace: UnityEngine.Purchasing
Assembly: UnityEngine.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
consumePurchase
Consume successful purchases immediately.
Declaration
[Tooltip("Consume successful purchases immediately.")]
public bool consumePurchase
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
onProductsFetched
Event fired after a successful fetching the products from the store.
Declaration
[Tooltip("Event fired after a successful fetching the products from the store.")]
public IAPListener.OnProductsFetchedEvent onProductsFetched
Field Value
| Type | Description |
|---|---|
| IAPListener.OnProductsFetchedEvent |
See Also
onPurchaseComplete
Event fired after a successful purchase of this product.
Declaration
[Tooltip("Event fired after a successful purchase of this product.")]
public IAPListener.OnPurchaseCompletedEvent onPurchaseComplete
Field Value
| Type | Description |
|---|---|
| IAPListener.OnPurchaseCompletedEvent |
See Also
onPurchaseDetailedFailedEvent
Event fired after a failed purchase of this product.
Declaration
[Tooltip("Event fired after a failed purchase of this product.")]
public IAPListener.OnPurchaseDetailedFailedEvent onPurchaseDetailedFailedEvent
Field Value
| Type | Description |
|---|---|
| IAPListener.OnPurchaseDetailedFailedEvent |
See Also
onPurchaseFailed
Event fired after a failed purchase of this product.
Declaration
[Tooltip("Event fired after a failed purchase of this product.")]
public IAPListener.OnPurchaseFailedEvent onPurchaseFailed
Field Value
| Type | Description |
|---|---|
| IAPListener.OnPurchaseFailedEvent |
See Also
Methods
OnPurchaseFailed(Product, PurchaseFailureDescription)
Invoked on a failed purchase a product
Declaration
public void OnPurchaseFailed(Product product, PurchaseFailureDescription description)
Parameters
| Type | Name | Description |
|---|---|---|
| Product | product | The |
| PurchaseFailureDescription | description | Information to help developers recover from this failure |
See Also
OnPurchaseFailed(Product, PurchaseFailureReason)
Invoked on a failed purchase of the product associated with this button
Declaration
public void OnPurchaseFailed(Product product, PurchaseFailureReason reason)
Parameters
| Type | Name | Description |
|---|---|---|
| Product | product | The |
| PurchaseFailureReason | reason | Information to help developers recover from this failure |
See Also
ProcessPurchase(PurchaseEventArgs)
Invoked to process a successful purchase of the product associated with this button
Declaration
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| PurchaseEventArgs | e | The successful |
Returns
| Type | Description |
|---|---|
| PurchaseProcessingResult | The result of the successful purchase |