Use this page with AI

Copy this into your coding assistant and add your request.

Read https://openiap.dev/docs/apis/android/show-in-app-messages-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 showInAppMessagesAndroid

Shows Google Play billing in-app messages, such as transactional subscription updates. OpenIAP support starts in Spec 2.1.0 and openiap-google 2.3.0. The upstream API is available in Play Billing 4.1.0+; Play Billing 9.0+ also uses transactional messages for pending subscription price-increase opt-ins.

Wraps BillingClient.showInAppMessages(...). If the result is 'subscription-status-updated', use the returned purchaseToken to refresh the affected subscription state. Google recommends checking transactional messages whenever the app opens. This API implements the React Native request tracked in issue #221.

Signature

kt
suspend fun showInAppMessages(
    activity: Activity,
    params: InAppMessageParamsAndroid? = null
): InAppMessageResultAndroid

Parameters#

Optional InAppMessageParamsAndroid:

Returns#

Promise<InAppMessageResultAndroid> with:

  • responseCode (InAppMessageResponseCodeAndroid) - result of the in-app message flow.
  • purchaseToken (string | null) - present when a subscription status changed.

Example

kt
val result = openIapStore.showInAppMessages(
    activity,
    InAppMessageParamsAndroid(
        categories = listOf(InAppMessageCategoryAndroid.Transactional)
    )
)