lightbulb_outline Please take our October 2018 developer survey. Start survey

BillingClient.Builder

public static final class BillingClient.Builder
extends Object

java.lang.Object
   ↳ com.android.billingclient.api.BillingClient.Builder


Builder to configure and create a BillingClient instance.

Summary

Public methods

BillingClient build()

Creates a Billing client instance.

BillingClient.Builder setListener(PurchasesUpdatedListener listener)

Specify a valid listener for onPurchasesUpdated event.

Inherited methods

From class java.lang.Object

Public methods

build

BillingClient build ()

Creates a Billing client instance.

After creation, it will not yet be ready to use. You must initiate setup by calling startConnection(BillingClientStateListener) and wait for setup to complete.

Returns
BillingClient BillingClient instance

Throws
IllegalArgumentException if Context or PurchasesUpdatedListener were not set.

setListener

BillingClient.Builder setListener (PurchasesUpdatedListener listener)

Specify a valid listener for onPurchasesUpdated event.

Parameters
listener PurchasesUpdatedListener: Your listener for app initiated and Play Store initiated purchases.

Returns
BillingClient.Builder