This class provides abstract access to the native IAP (In App Purchases).
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Platforms InAppPurchase
DeltaEngine.InAppPurchase.PayPal PayPalInAppPurchases
DeltaEngine.Platforms.Mocks MockInAppPurchase
Namespace: DeltaEngine.Platforms
Assembly: DeltaEngine.Platforms (in DeltaEngine.Platforms.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The InAppPurchase type exposes the following members.
Constructors
Name | Description | |
---|---|---|
InAppPurchase | Initializes a new instance of the InAppPurchase class |
Methods
Name | Description | |
---|---|---|
InvokeOnReceivedProductInformation | ||
InvokeOnTransactionFinished | ||
InvokeOnUserCanceled | ||
PurchaseProductAsync | ||
RequestProductInformationAsync |
Events
Name | Description | |
---|---|---|
OnReceivedProductInformation | ||
OnTransactionFinished | ||
OnUserCanceled |
Remarks
Examples
[Test] public void RequestProductInformation() { var inAppPurchase = GetMockInAppPurchase(); inAppPurchase.OnReceivedProductInformation += ReceivedProductInformation; Assert.IsTrue(inAppPurchase.RequestProductInformationAsync(new[] { 0 })); }
[Test] public void PurchaseProductSuccessfully() { var inAppPurchase = GetMockInAppPurchase(); inAppPurchase.OnTransactionFinished += PurchaseProduct; Assert.IsTrue(inAppPurchase.PurchaseProductAsync(inAppPurchase.TestProductData)); }
[Test] public void PurchaseProductCanceled() { var inAppPurchase = GetMockInAppPurchase(); inAppPurchase.OnUserCanceled += PurchaseCanceled; inAppPurchase.InvokeOnUserCanceled("testId"); }
See Also