InAppPurchase ClassDelta Engine Documentation
This class provides abstract access to the native IAP (In App Purchases). View code on GitHub
Inheritance Hierarchy

System Object
  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

public abstract class InAppPurchase

The InAppPurchase type exposes the following members.

Constructors

  NameDescription
Protected methodInAppPurchase
Initializes a new instance of the InAppPurchase class
Top
Methods

  NameDescription
Public methodInvokeOnReceivedProductInformation
Public methodInvokeOnTransactionFinished
Public methodInvokeOnUserCanceled
Public methodPurchaseProductAsync
Public methodRequestProductInformationAsync
Top
Events

  NameDescription
Public eventOnReceivedProductInformation
Public eventOnTransactionFinished
Public eventOnUserCanceled
Top
Remarks

Tests: DeltaEngine.Platforms.Tests.InAppPurchaseTests
Examples

3 unit tests call DeltaEngine.Platforms.InAppPurchase
[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