Interface PurchaseObserver


public interface PurchaseObserver
Observer interface to wait for the purchase manager to initialize as well as to handle restored/refunded transactions.

Calling thread of callback methods might not be libGDX main loop thread!

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called when the purchase manager has successfully initialized.
    void
    Called when the installation of the purchase manager failed.
    void
    handlePurchase(com.badlogic.gdx.pay.Transaction transaction)
    The item that was purchased.
    void
    Called when a purchase is canceled by the user.
    void
    Called when a purchase failed for unexpected reasons.
    void
    handleRestore(com.badlogic.gdx.pay.Transaction[] transactions)
    Called when purchases have been restored.
    void
    Called when a restore failed for unexpected reasons.
  • Method Details

    • handleInstall

      void handleInstall()
      Called when the purchase manager has successfully initialized.

      The in-app purchase service has been connected, and in-app products have been successfully retrieved from the in-app payment service.

      Calling thread might not be Libgdx main loop thread!

    • handleInstallError

      void handleInstallError(Throwable e)
      Called when the installation of the purchase manager failed.
      Parameters:
      e - The error, e.g. network outage, invalid keys, etc.

      Calling thread might not be libGDX main loop thread!

    • handleRestore

      void handleRestore(com.badlogic.gdx.pay.Transaction[] transactions)
      Called when purchases have been restored. The "valid" parameter will indicate if the purchase was successful (true) or was aborted or refunded by the user (false).

      Calling thread might not be libGDX main loop thread!

      Parameters:
      transactions - The restored purchases.
    • handleRestoreError

      void handleRestoreError(Throwable e)
      Called when a restore failed for unexpected reasons.
      Parameters:
      e - The error, e.g. network outage, invalid identifier, etc.

      Calling thread might not be libGDX main loop thread!

    • handlePurchase

      void handlePurchase(com.badlogic.gdx.pay.Transaction transaction)
      The item that was purchased. The "valid" parameter will indicate if the purchase was successful (true) or was aborted or refunded by the user (false).
      Parameters:
      transaction - The purchased item information.

      Calling thread might not be libGDX main loop thread!

    • handlePurchaseError

      void handlePurchaseError(Throwable e)
      Called when a purchase failed for unexpected reasons.
      Parameters:
      e - The error, e.g. network outage, invalid identifier, etc.

      Calling thread might not be libGDX main loop thread!

    • handlePurchaseCanceled

      void handlePurchaseCanceled()
      Called when a purchase is canceled by the user.

      Calling thread might not be libGDX main loop thread!