Package com.prineside.tdi2
Class OkPurchaseManager
java.lang.Object
com.prineside.tdi2.OkPurchaseManager
- All Implemented Interfaces:
com.badlogic.gdx.pay.InformationFinder
,com.badlogic.gdx.pay.PurchaseManager
public abstract class OkPurchaseManager
extends Object
implements com.badlogic.gdx.pay.PurchaseManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes the purchase manager.com.badlogic.gdx.pay.Information
getInformation
(String identifier) Returns information about a product provided by the purchase manager.void
install
(com.badlogic.gdx.pay.PurchaseObserver observer, com.badlogic.gdx.pay.PurchaseManagerConfig config, boolean autoFetchInformation) Registers a purchase observer which handles installs of apps on a new device or aborted purchases from a previous session that were not yet handled by the application.boolean
Returns true if the purchase manager is installed (non-disposed) and ready to go.void
Requests to purchase an item.abstract void
purchaseOk
(String okIapId, String productId) void
Restores existing purchases.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.badlogic.gdx.pay.PurchaseManager
storeName
-
Constructor Details
-
OkPurchaseManager
public OkPurchaseManager()
-
-
Method Details
-
getInformation
Description copied from interface:com.badlogic.gdx.pay.InformationFinder
Returns information about a product provided by the purchase manager.- Specified by:
getInformation
in interfacecom.badlogic.gdx.pay.InformationFinder
- Returns:
- the information for given identifier, or
Information.UNAVAILABLE
if no product for givenidentifier
is loaded.
-
install
public void install(com.badlogic.gdx.pay.PurchaseObserver observer, com.badlogic.gdx.pay.PurchaseManagerConfig config, boolean autoFetchInformation) Description copied from interface:com.badlogic.gdx.pay.PurchaseManager
Registers a purchase observer which handles installs of apps on a new device or aborted purchases from a previous session that were not yet handled by the application. The observer is called for all unfinished transactions. The observer is also called for refunds of previous purchased items.Registering an observer is required. If no observer is registered the call to purchase an item will fail with a runtime exception to teach you lesson to always remember to set a purchase observer. The purchase observer is needed to make sure all purchases have been handled and served to the customer.
- Specified by:
install
in interfacecom.badlogic.gdx.pay.PurchaseManager
- Parameters:
observer
- The observer which is called whenever purchases have to be handled by the application as well as when the store has been installed.config
- The configuration. Please note offers inside the configuration can be updated on the fly (e.g. byautoFetchInformation
- tells PurchaseManager to automatically fetch offer details on setup
-
installed
public boolean installed()Description copied from interface:com.badlogic.gdx.pay.PurchaseManager
Returns true if the purchase manager is installed (non-disposed) and ready to go.- Specified by:
installed
in interfacecom.badlogic.gdx.pay.PurchaseManager
-
dispose
public void dispose()Description copied from interface:com.badlogic.gdx.pay.PurchaseManager
Disposes the purchase manager.- Specified by:
dispose
in interfacecom.badlogic.gdx.pay.PurchaseManager
-
purchaseOk
-
purchase
Description copied from interface:com.badlogic.gdx.pay.PurchaseManager
Requests to purchase an item. The listener will always be called once the purchase has either completed or failed.Note: a GDX runtime exception is thrown if you have not registered a purchase observer.
- Specified by:
purchase
in interfacecom.badlogic.gdx.pay.PurchaseManager
- Parameters:
identifier
- The item to purchase.
-
purchaseRestore
public void purchaseRestore()Description copied from interface:com.badlogic.gdx.pay.PurchaseManager
Restores existing purchases.- Specified by:
purchaseRestore
in interfacecom.badlogic.gdx.pay.PurchaseManager
-