Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FR] Support BillingClient.showInAppMessages() (Android in-app messaging) #221

Description

@aadityapaliwal94

Library or package

react-native-iap

Target platform

Android

Target store

Google Play Store

Problem or use case

Google Play Billing exposes BillingClient.showInAppMessages() to show transactional in-app messages (e.g. payment issue snackbars, pending price-increase opt-ins) via InAppMessageParams with InAppMessageCategoryId.TRANSACTIONAL. Google recommends calling this every time the app opens.

react-native-iap currently has no equivalent API, and the internal BillingClient instance isn't exposed, so consumers can't easily wire this up without spinning up a second, separate BillingClient themselves.

Proposed solution

Expose an Android-only method, e.g.:
import { showInAppMessages } from 'react-native-iap';

const result = await showInAppMessages({
categories: ['transactional'], // maps to InAppMessageCategoryId
});

if (result.responseCode === 'SUBSCRIPTION_STATUS_UPDATED') {
// result.purchaseToken available to refresh subscription status
// via the Google Play Developer API
}

This would reuse the existing internal BillingClient connection rather than requiring a second instance, and resolve with either NO_ACTION_NEEDED or SUBSCRIPTION_STATUS_UPDATED (+ purchaseToken), matching the native InAppMessageResult API.

Alternatives considered

No response

Additional context

https://developer.android.com/google/play/billing/subscriptions#in-app-messaging

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions