Android enableBillingProgramAndroid

Enables a billing program for Android. Billing Choice support starts in OpenIAP Spec 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" }