com.annahid.libs.artenus.unified
InventoryManager
Superclass for all in-app billing managers. A unified services implementation should return an
instance of this class if it handles in-app products and subscriptions.
public abstract class InventoryManager
Constructor Summary
| Modifier and Type | Constructor and Description |
|---|---|
protected | InventoryManager() Creates an empty instance of InventoryManager. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
public abstract void | consume(ProductReceipt receipt) Consumes a previously purchased product. |
protected final InventoryListener | getListener() Gets the current inventory listener responsible for this instance. |
protected final String | getSKUs() Gets the list of SKUs currently handled by this instance. |
public abstract boolean | isBillingSupported() Determines whether the store supports in-app billing. |
public abstract boolean | onActivityResult(int requestCode, int resultCode, Intent data) Called internally by onActivityResult(int, int, Intent) to handle
activity results for in-app billing. |
public abstract void | onCreate(Context context) Called internally as part of onCreate(Context). |
public abstract void | onDestroy(Context context) Called internally as part of onCreate(Context). |
public abstract void | purchase(String sku) Launches a purchase flow for the specified product. |
public final void | setListener(InventoryListener listener) Appoints a new listener to handle in-app billing events for this instance. |
public final void | setSKUs(String[] inventorySKUs) Sets the list of SKUs of interest. |
public abstract void | subscribe(String sku) Launches a subscription flow for the specified subscription SKU. |
Methods inherited from java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitConstructor Detail
| InventoryManager |
|---|
protected InventoryManager()Creates an empty instance of InventoryManager. |
Method Detail
| consume | ||
|---|---|---|
public abstract void consume(
ProductReceipt receipt
)Consumes a previously purchased product. Parameters:
See Also:
|
| getListener |
|---|
protected final InventoryListener getListener() Gets the current inventory listener responsible for this instance. Returns:
Current inventory listener, or null if non-existent |
| getSKUs |
|---|
protected final String getSKUs() Gets the list of SKUs currently handled by this instance. Returns:
List of product SKUs |
| isBillingSupported |
|---|
public abstract boolean isBillingSupported() Determines whether the store supports in-app billing. Returns:
true if in-app billing is supported, false otherwise |
| onActivityResult | ||||||
|---|---|---|---|---|---|---|
public abstract boolean onActivityResult(
int requestCode,
int resultCode,
Intent data
)Called internally by onActivityResult(int, int, Intent) to handle
activity results for in-app billing.Parameters:
Returns:
true if handled by inventory manager, false otherwise |
| onCreate | ||
|---|---|---|
public abstract void onCreate(
Context context
)Called internally as part of onCreate(Context).Parameters:
|
| onDestroy | ||
|---|---|---|
public abstract void onDestroy(
Context context
)Called internally as part of onCreate(Context).Parameters:
|
| purchase | ||
|---|---|---|
public abstract void purchase(
String sku
)Launches a purchase flow for the specified product. The result will be reported to the
inventory listener associated with this instance. Parameters:
See Also:
|
| setListener | ||
|---|---|---|
public final void setListener(
InventoryListener listener
)Appoints a new listener to handle in-app billing events for this instance. Parameters:
|
| setSKUs | ||
|---|---|---|
public final void setSKUs(
String[] inventorySKUs
)Sets the list of SKUs of interest. In order for the system to load SKUs at startup, they
should all be included for this call. Parameters:
|
| subscribe | ||
|---|---|---|
public abstract void subscribe(
String sku
)Launches a subscription flow for the specified subscription SKU. Parameters:
|