Use this page with AI
Copy this into your coding assistant and add your request.
Read https://openiap.dev/docs/apis/android/is-billing-program-available-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]Android isBillingProgramAvailableAndroid
Step 1 of Billing Programs API. Check if a billing program is available for the current user.
Wraps BillingClient.isBillingProgramAvailableAsync(BillingProgram) — replaces isExternalOfferAvailableAsync. Play Billing 8.2.0+; External Offer integrations require Play Billing 8.2.1+. Billing Choice fields are available in OpenIAP 2.1.0 and openiap-google 2.3.0 and require Play Billing 9.1.0+. See the Google Play Billing reference.
Signature
kt
// Returns BillingProgramAvailabilityResultAndroid with isAvailable flag
// Throws OpenIapError.NotPrepared if billing client not ready
suspend fun isBillingProgramAvailable(
program: BillingProgramAndroid
): BillingProgramAvailabilityResultAndroidParameters#
program(required,BillingProgramAndroid) — Billing program identifier.
Returns#
Promise<BillingProgramAvailabilityResultAndroid> — carries:
billingProgram(BillingProgramAndroid) — Echoes back the program that was checked.isAvailable(boolean) — Whether the billing program is available for this user/device.choiceScreenType(BillingChoiceScreenTypeAndroid| null) — Populated only for available'billing-choice'results.isExternalLinkAvailable(boolean | null) — Whether external-link developer billing is available for Billing Choice.
Example
kt
val result = openIapStore.isBillingProgramAvailable(
BillingProgramAndroid.ExternalOffer
)