BillingClient constructor

BillingClient(
  1. PurchasesUpdatedListener onPurchasesUpdated,
  2. UserSelectedAlternativeBillingListener? alternativeBillingListener, {
  3. @visibleForTesting InAppPurchaseApi? api,
})

Creates a billing client.

Implementation

BillingClient(
  PurchasesUpdatedListener onPurchasesUpdated,
  UserSelectedAlternativeBillingListener? alternativeBillingListener, {
  @visibleForTesting InAppPurchaseApi? api,
})  : _hostApi = api ?? InAppPurchaseApi(),
      hostCallbackHandler = HostBillingClientCallbackHandler(
          onPurchasesUpdated, alternativeBillingListener) {
  InAppPurchaseCallbackApi.setUp(hostCallbackHandler);
}