Loading...
Loading...
Use this skill when handling failed renewals on Android with RevenueCat. Covers how Grace Period and Account Hold are reflected in CustomerInfo automatically, when to prompt the user, and how to trigger Google's in app messaging via showInAppMessages.
npx skill4agent add revenuecat/ai-toolkit rc-payment-recoveryCustomerInfo| State | Access | How RevenueCat surfaces it | User sees |
|---|---|---|---|
| Grace period | Retained | | Google in app snackbar by default |
| Account hold | Revoked | | Google in app snackbar by default |
| Recovered | Retained | | Nothing |
EntitlementInfo.billingIssueDetectedAtEntitlementInfo.isActiveBILLING_ISSUEshowInAppMessagesIfNeededbillingIssueDetectedAtCustomerInfoisActiveshowInAppMessagesIfNeeded(activity)BILLING_ISSUEPurchasesConfiguration.Builder(context, apiKey)
.showInAppMessagesAutomatically(true)
.build()PurchasesConfiguration.Builder(context, apiKey)
.showInAppMessagesAutomatically(false)
.build()
Purchases.sharedInstance.showInAppMessagesIfNeeded(activity)val entitlement = customerInfo.entitlements["pro_access"]
when {
entitlement == null || !entitlement.isActive ->
showSubscribeScreen()
entitlement.billingIssueDetectedAt != null && entitlement.isActive ->
showGracePeriodWarning()
entitlement.billingIssueDetectedAt != null && !entitlement.isActive ->
showAccountHoldScreen()
else ->
showPremiumContent()
}CustomerInfo.managementURLcustomerInfo.managementURL?.let { url ->
startActivity(Intent(Intent.ACTION_VIEW, url))
}entitlement.billingIssueDetectedAtisActivetrueisActivefalsebillingIssueDetectedAtbillingIssueDetectedAtnullBILLING_ISSUE