Copy this into your coding assistant and add your request.
Read https://openiap.dev/docs/events/android/developer-provided-billing-listener-android and https://openiap.dev/llms.txt. Follow the reading instructions, detailed reference, and linked guides relevant to my task before making changes.
Inspect my existing project and reuse its framework and conventions. Ask me for missing product decisions. Implement the requested behavior and run the applicable checks.
Show the working result, the commands and actual test results, and any remaining limitations. Keep your explanation brief.
My request: [describe what customers should be able to do]
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 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.
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
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
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.