Loading...
Loading...
Use this skill when surfacing cancellation, pause, and winback state on Android with RevenueCat. Covers reading unsubscribeDetectedAt, billingIssuesDetectedAt, pause state via periodType, managementURL for deep link, and pause resume date lookup via the REST API.
npx skill4agent add revenuecat/ai-toolkit rc-cancellations-pauses-winbackCustomerInfomanagementURL| State | Signal in CustomerInfo | Notes |
|---|---|---|
| Canceled, still has access | | Show "ends on [expirationDate]" |
| Billing issue (grace or hold) | | Payment failed, recovery in progress |
| Paused | | Resume date requires REST API |
| Active and renewing | | Normal state |
CANCELLATIONcancel_reasonUNSUBSCRIBEBILLING_ERRORDEVELOPER_INITIATEDPRICE_INCREASECustomerInfoPurchases.sharedInstance.getCustomerInfo(...)BillingClient.queryPurchasesAsyncsetIncludeSuspendedSubscriptions(true)managementURLUri?Uri.parse(url.toString())expirationDateisActivewillRenew/v1/subscribers/{app_user_id}val entitlement = customerInfo.entitlements["pro_access"]
if (entitlement?.unsubscribeDetectedAt != null && entitlement.isActive) {
entitlement.expirationDate?.let { expiry ->
showCancellationBanner(expiry)
}
}unsubscribeDetectedAtSUBSCRIPTION_CANCELEDisActivetrueval entitlement = customerInfo.entitlements["pro_access"]
val hasAccess = entitlement?.isActive == true
// When paused, isActive == false. Pause resume date is not in the SDK.customerInfo.managementURL?.let { url ->
startActivity(Intent(Intent.ACTION_VIEW, url))
}managementURLUri?Uri.parse(url.toString())paused_expiration_time_mscurl -H "Authorization: Bearer $RC_SECRET_API_KEY" \
https://api.revenuecat.com/v1/subscribers/$APP_USER_IDpaused_expiration_time_msSUBSCRIPTION_RESTARTEDunsubscribeDetectedAtwillRenew = truecustomerInfoRENEWALINITIAL_PURCHASE| Check | How |
|---|---|
| Cancellation banner shows | Cancel in Play Store, pull fresh |
| Management deep link opens | Tap the link, verify Play subscriptions screen opens for the correct product |
| Pause is reflected | Pause in Play Store sandbox, confirm |
| Pause resume date | Call |
| Win back accepted | Accept a Play configured win back offer, confirm the purchase surfaces as a normal subscription in |
purchases.subscriptionsv2.deferpurchases.subscriptionsv2.revokeCustomerInfoCustomerInfo