[EN]PurchaseClient

public abstract class BillingClient extends Object java.lang.Object

↳ com.gaa.sdk.iap.PurchaseClient

The default interface for communication between the library and the user application code. Every method is processed asynchronously. It must be called from the UI thread and every call back is restored to the UI thread. When it calls the startConnection (PurchaseClientStateListener) method and the setting is complete, it can receive notifications through the listener to set the connection setting after instantiating this class.

In general, it calls the purchase history check and the details of in-app products. Please refer to queryPurchasesAsync(String, QueryPurchasesListner) and queryProductDetailsAsync(ProductDetailsParams, ProductDetailsListener). Please do not forget to call endConnection() when the work is done with this object and end the application. It needs to disconnect and remove resources from the billing module. The recommended location is Activity.onDestroy(). To check the detailed log of the library, enter android.util.Log.VEROSE in Logger.setLogLevel(int). Caution: Please remove Logger.setLogLevel(int) before releasing the release version of the application.

Summary


Public methods


newBuilder

@AnyThreadpublic static PurchaseClient.Builder newBuilder(Context context) Generates the builder to create a PurchaseClient instance.

isReady

@AnyThreadpublic abstract boolean isReady() Checks if the client is connected to the current service to check whether the request of other functions succeed.

getConnectionState

@AnyThreadpublic abstract int getConnectionState() Restores the connection state of the current PurchaseClient.

isFeatureSupported

@UiThread public abstract IapResult isFeatureSupported(String feature) Checks whether or not the specified feature is supported by the service.

startConnection

@AnyThreadpublic abstract void startConnection(PurchaseClientStateListener listener) Starts PurchaseClient setting process asynchronously. It receives responses through PurchaseClientStateListener.

endConnection

@AnyThreadpublic abstract void endConnection() Disconnects from the billing module and removes retained resources of PurchaseClient.

launchUpdateOrInstallFlow

@UiThreadpublic abstract void launchUpdateOrInstallFlow(Activity activity, IapResultListener listener) Needs to call for an update or installation of the billing module when the value of IapResult.getResponseCode() occurs as PurchaseClient.ResponseCode.RESULT_NEED_UPDATE

launchPurchaseFlow

@UiThread public abstract IapResult launchPurchaseFlow(Activity activity, PurchaseFlowParams params) Starts purchasing in-app products. The purchase page displays and it receives response results by PurchasesUpdatedListener that is specified when PurchaseClient was initialized.

consumeAsync

@AnyThreadpublic abstract void consumeAsync(ConsumeParams params, ConsumeListener listener) Consumes the purchased products. It can be processed for only owned products and it needs to be purchased again if the products are consumed already. Caution: It will be refunded if it is not consumed or acknowledged within 3 days of the purchase date from API v6.

acknowledgeAsync

@AnyThread public abstract void acknowledgeAsync(AcknowledgeParams acknowledgeParams, AcknowledgeListener listener) Acknowledges purchased products. It can be processed for only owned products and it can't be purchased again if the acknowledged product is not consumed. It can be applied on all management-type products or monthly auto-renewal products. In particular, for management-type products, it is able to be used as subscription products that can be acknowledged and consumed after a certain time period. Caution: It will be refunded if it doesn't consume or acknowledge within 3 days of the purchase date from API v6.

queryPurchasesAsync

@AnyThread public abstract void queryPurchasesAsync(String productType, [EN]QueryPurchasesListener listener) Brings the purchase information of every purchased product from the app.

queryProductDetailsAsync

@AnyThread public abstract void queryProductDetailsAsync(ProductDetailsParams params, ProductDetailsListener listener) Brings the detailed information of the registered in-app products in the developer center.

manageRecurringProductAsync

@AnyThread public abstract void manageRecurringProductAsync(RecurringProductParams recurringProductParams, RecurringProductListener listener) Changes the status of monthly auto-renewal products. It processes the action of canceling automatic payment for every month or resuming the canceled monthly auto-renewal product again.

launchLoginFlowAsync

@UiThread public abstract void launchLoginFlowAsync(Activity activity, IapResultListener listener) Processes store login when the value PurchaseClient.ResponseCode.RESULT_NEED_LOGIN is occured.

launchManageSubscription

@UiThread public abstract void launchManageSubscription(Activity activity, SubscriptionParams[EN]SubscriptionParamssubscriptionParams) Moves to the subscription products management menu.

getStoreInfoAsync

@AnyThread public abstract void getStoreInfoAsync(StoreInfoListener listener) Brings the market identification code. This value is required when using server to server API.

Last updated