Use this page with AI

Copy this into your coding assistant and add your request.

Read https://openiap.dev/docs/apis/android/enable-billing-program-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]
See an example request →

Android enableBillingProgramAndroid

Enables a billing program for Android. Billing Choice support starts in OpenIAP 2.1.0 and openiap-google 2.3.0 and requires Play Billing 9.1.0+. Pass it as the enableBillingProgramAndroid field of InitConnectionConfig when calling initConnection() — there is no separate top-level call.

Sets enableBillingProgramAndroid on InitConnectionConfig; under the hood it configures BillingClient.Builder.enableBillingPrograms(...) (Play Billing 8.2.0+). External Offer integrations must use Play Billing 8.2.1+ and create fresh reporting details immediately before each external-link launch. Use 'billing-choice' for Play Billing Billing Choice. See the Google Play Billing reference.

Signature

kt
// Config field on InitConnectionConfig — wired via initConnection()
data class InitConnectionConfig(
    val enableBillingProgramAndroid: BillingProgramAndroid? = null,
    // ...other fields
)

Config field#

enableBillingProgramAndroid on InitConnectionConfig: optional BillingProgramAndroid. Pass the program identifier you want to enable (e.g. 'external-offer') as part of the config you hand to initConnection(); the connection succeeds with the program enabled, and initConnection()'s own Promise<boolean> return value indicates the overall connection result. There is no separate enableBillingProgramAndroid() call.

Example

kt
check(openIapStore.initConnection(
    InitConnectionConfig(
        enableBillingProgramAndroid = BillingProgramAndroid.ExternalOffer
    )
)) { "Store connection failed" }