feat: implement billing and subscription management screen with RevenueCat integration
This commit is contained in:
@@ -308,6 +308,18 @@ const getValidProEntitlement = (customerInfo) => {
|
||||
return proEntitlement;
|
||||
}
|
||||
|
||||
// Fallback: entitlement is active but backed by a non-subscription product (e.g. a topup
|
||||
// that was previously misconfigured to grant the pro entitlement). If the user also has a
|
||||
// supported subscription product in their purchase history, honour the entitlement anyway.
|
||||
const purchased = Array.isArray(customerInfo?.allPurchasedProductIdentifiers)
|
||||
? customerInfo.allPurchasedProductIdentifiers
|
||||
: [];
|
||||
const hasSubscription = purchased.some((id) => SUPPORTED_SUBSCRIPTION_PRODUCTS.has(id));
|
||||
if (hasSubscription) {
|
||||
console.warn('[Billing] Pro entitlement backed by unsupported product but subscription found — honouring entitlement', summarizeRevenueCatCustomerInfo(customerInfo));
|
||||
return proEntitlement;
|
||||
}
|
||||
|
||||
console.warn('[Billing] Ignoring unsupported RevenueCat pro entitlement', summarizeRevenueCatCustomerInfo(customerInfo));
|
||||
return null;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user