Package 

Class InAppPurchaseLibrary

    • Method Detail

      • onReady

         static void onReady(Context context, DaemonRequest.Callback callback)

        Sets a callback to be triggered when Payments operations are available.

        Parameters:
        context - the application context
        callback - callback for success and error
      • getCatalog

         static void getCatalog(Context context, DaemonRequest.Callback callback)

        Fetches the game's product catalog.

        Parameters:
        context - the application context
        callback - callback for success and error
      • getPurchases

         static void getPurchases(Context context, DaemonRequest.Callback callback)

        Fetches all of the player's unconsumed purchases. The game must fetch the current player'spurchases as soon as the client indicates that it is ready to perform payments-relatedoperations, i.e. at game start. The game can then process and consume any purchases that arewaiting to be consumed.

        Parameters:
        context - the application context
        callback - callback for success and error
      • purchase

         static void purchase(Context context, String productID, @Nullable() String developerPayload, DaemonRequest.Callback callback)

        Begins the purchase flow for a specific product.

        Parameters:
        context - the application context
        productID - the productID of the item to be purchased, obtained from the catalog
        developerPayload - the optional string payload to be associated with the purchase
        callback - callback for success and error
      • consumePurchase

         static void consumePurchase(Context context, String purchaseToken, DaemonRequest.Callback callback)

        Consumes a specific purchase belonging to the current player. Before provisioning a product'seffects to the player, the game should request the consumption of the purchased product. Oncethe purchase is successfully consumed, the game should immediately provide the player with theeffects of their purchase.

        Parameters:
        context - the application context
        purchaseToken - the purchase token associated with a transaction
        callback - callback for success and error