Package com.badlogic.gdx.pay
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 TypeMethodDescriptionvoidCalled when the purchase manager has successfully initialized.voidCalled when the installation of the purchase manager failed.voidhandlePurchase(com.badlogic.gdx.pay.Transaction transaction) The item that was purchased.voidCalled when a purchase is canceled by the user.voidCalled when a purchase failed for unexpected reasons.voidhandleRestore(com.badlogic.gdx.pay.Transaction[] transactions) Called when purchases have been restored.voidCalled 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
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
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
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!
-