public static final class BillingClient.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
BillingClient |
build()
Creates a Billing client instance.
|
BillingClient.Builder |
setChildDirected(int childDirected)
Developers are able to specify whether this app is child directed or not to ensure compliance
with US COPPA & EEA age of consent laws.
|
BillingClient.Builder |
setListener(PurchasesUpdatedListener listener)
Specify a valid listener for onPurchasesUpdated event.
|
BillingClient.Builder |
setUnderAgeOfConsent(int underAgeOfConsent)
Developers are able to specify whether this app is under age of consent or not to ensure
compliance with US COPPA & EEA age of consent laws.
|
@UiThread public BillingClient.Builder setListener(PurchasesUpdatedListener listener)
listener - Your listener for app initiated and Play Store initiated purchases.@UiThread public BillingClient.Builder setChildDirected(int childDirected)
This is most relevant for rewarded skus as child directed applications are explicitly not allowed to collect information that can be used to personalize the rewarded videos to the user.
@UiThread public BillingClient.Builder setUnderAgeOfConsent(int underAgeOfConsent)
This is most relevant for rewarded skus as under age of consent applications are explicitly not allowed to collect information that can be used to personalize the rewarded videos to the user.
@UiThread public BillingClient build()
After creation, it will not yet be ready to use. You must initiate setup by calling BillingClient.startConnection(com.android.billingclient.api.BillingClientStateListener) and wait for setup to complete.
IllegalArgumentException - if Context or PurchasesUpdatedListener were not set.