BillingClient class

This class can be used directly instead of InAppPurchaseConnection to call Play-specific billing APIs.

Wraps a com.android.billingclient.api.BillingClient instance.

In general this API conforms to the Java com.android.billingclient.api.BillingClient API as much as possible, with some minor changes to account for language differences. Callbacks have been converted to futures where appropriate.

Constructors

BillingClient(PurchasesUpdatedListener onPurchasesUpdated)

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

acknowledgePurchase(String purchaseToken, {String developerPayload}) Future<BillingResultWrapper>
Acknowledge an in-app purchase. [...]
callHandler(MethodCall call) Future<void>
@visibleForTesting
consumeAsync(String purchaseToken, {String developerPayload}) Future<BillingResultWrapper>
Consumes a given in-app product. [...]
enablePendingPurchases() → void
Enable the BillingClientWrapper to handle pending purchases. [...]
endConnection() Future<void>
Calls `BillingClient#endConnection(BillingClientStateListener)`(https://developer.android.com/reference/com/android/billingclient/api/BillingClient.html#endconnect to disconnect a BillingClient instance. [...]
isReady() Future<bool>
Calls BillingClient#isReady() to get the ready status of the BillingClient instance.
launchBillingFlow({String sku, String accountId}) Future<BillingResultWrapper>
Attempt to launch the Play Billing Flow for a given skuDetails. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
queryPurchaseHistory(SkuType skuType) Future<PurchasesHistoryResult>
Fetches purchase history for the given SkuType. [...]
queryPurchases(SkuType skuType) Future<PurchasesResultWrapper>
Fetches recent purchases for the given SkuType. [...]
querySkuDetails({SkuType skuType, List<String> skusList}) Future<SkuDetailsResponseWrapper>
Returns a list of SkuDetailsWrappers that have SkuDetailsWrapper.sku in skusList, and SkuDetailsWrapper.type matching skuType. [...]
startConnection({OnBillingServiceDisconnected onBillingServiceDisconnected}) Future<BillingResultWrapper>
Calls BillingClient#startConnection(BillingClientStateListener) to create and connect a BillingClient instance. [...]
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited