com.amazon.InAppSDK.purchasing
Class PurchasingManager

java.lang.Object
  extended by com.amazon.InAppSDK.purchasing.PurchasingManager

public final class PurchasingManager
extends java.lang.Object

The PurchasingManager presents the primary API for interacting with the Amazon Appstore for Android In App SDK: Purchasing Framework. Before using operations in this class, you must first register a PurchasingObserver instance via registerObserver(PurchasingObserver).


Method Summary
static java.lang.String initiateItemDataRequest(java.util.Set<java.lang.String> skus)
          Initiate a request to retrieve item data for between 1 and 100 SKUs.
static java.lang.String initiatePurchaseRequest(java.lang.String sku)
          Initiate a request to purchase a SKU.
static java.lang.String initiatePurchaseUpdatesRequest(Offset offset)
           Initiate a request to retrieve updates about items the customer has purchased and/or revoked since last time you checked.
static void registerObserver(PurchasingObserver purchasingObserver)
          You must register a PurchasingObserver before invoking operations in this class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerObserver

public static void registerObserver(PurchasingObserver purchasingObserver)
You must register a PurchasingObserver before invoking operations in this class. Good practice is to do this in your Activity's onStart lifecycle method.

Parameters:
purchasingObserver - The PurchasingObserver to register

initiatePurchaseRequest

public static java.lang.String initiatePurchaseRequest(java.lang.String sku)
Initiate a request to purchase a SKU. When a response is available, you will be notified with PurchasingObserver.notifyPurchaseResponse(PurchaseResponse).

Parameters:
sku - The vendor SKU to initiate a purchase for
Returns:
a request ID that you can use to associate this request with the PurchaseResponse received by the PurchasingObserver.notifyPurchaseResponse(PurchaseResponse) callback.

initiateItemDataRequest

public static java.lang.String initiateItemDataRequest(java.util.Set<java.lang.String> skus)
Initiate a request to retrieve item data for between 1 and 100 SKUs. When a response is available, you will be notified with PurchasingObserver.notifyItemDataResponse(ItemDataResponse).

Parameters:
skus - A set of SKUs you wish to retrieve Item data for. No more than 100 SKUs are allowed.
Returns:
a request ID that you can use to associate this request with the ItemDataResponse received by the PurchasingObserver.notifyItemDataResponse(ItemDataResponse) callback.

initiatePurchaseUpdatesRequest

public static java.lang.String initiatePurchaseUpdatesRequest(Offset offset)

Initiate a request to retrieve updates about items the customer has purchased and/or revoked since last time you checked. A good use of this operation is to invoke it once per application run to make sure your view of ownership is consistent across devices.

This operation works with paginated data. The beginning of the data set is specified by the Offset you provide here. The response will contain an Offset marking the beginning of the next data set, if more is available.

Parameters:
offset - Marks the beginning of the data set
Returns:
a request ID that you can use to associate this request with the PurchaseUpdatesResponse received by the PurchasingObserver.notifyPurchaseUpdatesResponse(PurchaseUpdatesResponse) callback.