showInAppMessages

open fun showInAppMessages(activity: Activity, @Nullable listener: InAppMessageListener)

Shows Google Play's in-app messages for the current user, if any apply.

The main use is recovering subscriptions whose payment was declined: rather than silently losing the subscriber, Play displays a fix-your-payment flow inside your app. Google recommends calling this on every foreground entry into the app for apps that sell subscriptions.

When the user recovers a purchase, this class refreshes its own state before invoking onSubscriptionRecovered, so isPurchased is already correct by the time the callback runs.

Since

4.4.0

Parameters

activity

The foreground activity to host the message.

listener

Optional callback for the outcome.