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
// Android only - not available on iOSRegisters 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.
const {
getBillingChoiceInfoAndroid,
showInAppMessagesAndroid,
} = useIAP({
enableBillingProgramAndroid: 'billing-choice',
billingChoiceScreenTypeAndroid: 'google-rendered',
onDeveloperProvidedBillingAndroid: (details) => {
void processDeveloperBilling(details).catch((error) => {
console.error('Developer billing failed', error);
});
},
});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
// Android only - not available on iOSexternalTransactionToken, 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
| Feature | User Choice Billing | Developer Provided Billing |
|---|---|---|
| Billing Library | 7.0+ | 8.3.0+ |
| Availability | Eligible regions | Program and market eligibility; External Payments launched in Japan, while Billing Choice uses separate eligibility. |
| When presented | During requestPurchase() | During requestPurchase() |
| UI | Google Play user-choice dialog in the billing flow | Program-specific in-app or external-link choice flow |
| Event | UserChoiceBillingAndroid | DeveloperProvidedBillingAndroid |
| Setup | enableBillingProgramAndroid: BillingProgramAndroid.UserChoiceBilling | Set 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.