BillingClient class

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

Wraps a instance.

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


BillingClient(PurchasesUpdatedListener onPurchasesUpdated)


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


acknowledgePurchase(String purchaseToken, {String developerPayload}) Future<BillingResultWrapper>
Acknowledge an in-app purchase. [...]
callHandler(MethodCall call) Future<void>
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)`( 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. [...]
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.


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