Hello,
Using
func isProGranted(customer: CustomerInfo) -> Bool {
if let entitlement = customer.entitlementst"PRO"] {
return entitlement.isActive
}
return false
}
In the Delegate Callback
extension SubscriptionViewModel:PurchasesDelegate {
func purchases(_ purchases: Purchases, receivedUpdated customerInfo: CustomerInfo) {
self.isPRO = manager.isProGranted(customer: customerInfo)
}
}
The problem is, it returns true when we Cancel Subscription or when it is automatically expired