I’m playing with a sandbox account and trying to disable premium features when the entitlement is no longer present. I have tried using the following code:
Purchases.shared.getCustomerInfo { customerInfo, error in
self.isActive = customerInfo?.entitlements["premium"]?.isActive == true
}
Setting a @State-var named isActive. It does get set to true when I make a test purchase, but when I cancel the subscription I never get false. If I kill my app and relaunch it I get an updated value saying false. How do I detect that a subscription/entitlement has expired between app launches? It seems everything is cached until I kill the app and then launch it again. I want the status to be updated at least every time the app enters the foreground. Any best practice for this?