Android developerProvidedBillingListenerAndroid

Fired when a user selects developer-provided billing in an External Payments or Billing Choice purchase flow. Billing Choice payload fields are available in OpenIAP Spec 2.1.0 and openiap-google 2.3.0, and require Play Billing 9.1.0+. Unlike User Choice Billing, this event is tied to the developer billing option configured for the purchase itself.

Eligibility: Availability depends on the enabled Google Play billing program and market. External Payments launched in Japan; Billing Choice has its own program eligibility.

Listener Setup

swift
// Android only - not available on iOS

Registers a listener for Developer Provided Billing events. This listener is triggered when the user selects the developer's payment option instead of Google Play in an enabled developer billing program.

React Native and Expo hook users can pass the same callback through onDeveloperProvidedBillingAndroid. The hook also accepts billingChoiceScreenTypeAndroid and returns the Billing Choice Android APIs.

ts
const {
  getBillingChoiceInfoAndroid,
  showInAppMessagesAndroid,
} = useIAP({
  enableBillingProgramAndroid: 'billing-choice',
  billingChoiceScreenTypeAndroid: 'google-rendered',
  onDeveloperProvidedBillingAndroid: (details) => {
    void processDeveloperBilling(details).catch((error) => {
      console.error('Developer billing failed', error);
    });
  },
});
kt
import dev.hyo.openiap.DeveloperProvidedBillingDetailsAndroid

// Using callback
openIapStore.addDeveloperProvidedBillingListener { details ->
    lifecycleScope.launch {
        val paymentResult = processPaymentWithYourGateway(
            products = details.products,
            linkUri = details.linkUri
        )

        if (paymentResult.success) {
            details.externalTransactionToken?.let { token ->
                reportExternalTransactionToGoogle(token)
            }
            grantUserAccess()
        }
    }
}

Event Payload

swift
// Android only - not available on iOS

externalTransactionToken, linkUri, and originalExternalTransactionId are nullable. The callback always includes products; each item has an id, type, and optional subscription offerToken.

Comparison: User Choice vs Developer Provided Billing

FeatureUser Choice BillingDeveloper Provided Billing
Billing Library7.0+8.3.0+
AvailabilityEligible regionsProgram and market eligibility; External Payments launched in Japan, while Billing Choice uses separate eligibility.
When presentedDuring requestPurchase()During requestPurchase()
UIGoogle Play user-choice dialog in the billing flowProgram-specific in-app or external-link choice flow
EventUserChoiceBillingAndroidDeveloperProvidedBillingAndroid
SetupenableBillingProgramAndroid: BillingProgramAndroid.UserChoiceBillingSet enableBillingProgramAndroid to ExternalPayments or BillingChoice, then pass developerBillingOption to requestPurchase.

Important: When Google Play returns an external transaction token, send it to your backend and report the completed external transaction within the applicable program deadline. Do not log or expose the token.

See Billing Programs types and the external purchase guide for setup and purchase examples.