Class IAPListener
An invisible GUI component for initializing Unity IAP and processing lifecycle events.
Inherited Members
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: UnityEngine.Purchasing
Assembly: solution.dll
Syntax
[AddComponentMenu("In-App Purchasing/IAP Listener")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.purchasing@latest")]
public class IAPListener : MonoBehaviour
Fields
| Name | Description |
|---|---|
| consumePurchase | Consume successful purchases immediately. |
| dontDestroyOnLoad | Preserve this GameObject when a new scene is loaded. |
| onProductsFetched | Event fired after a successful fetching the products from the store. |
| onPurchaseComplete | Event fired after a successful purchase of this product. |
| onPurchaseDetailedFailedEvent | Event fired after a failed purchase of this product. |
| onPurchaseFailed | Event fired after a failed purchase of this product. |
Methods
| Name | Description |
|---|---|
| OnPurchaseFailed(Product, PurchaseFailureDescription) | Invoked on a failed purchase a product |
| OnPurchaseFailed(Product, PurchaseFailureReason) | Invoked on a failed purchase of the product associated with this button |
| ProcessPurchase(PurchaseEventArgs) | Invoked to process a successful purchase of the product associated with this button |