I can see in my app (iOS) that users who become premium users (subscribers) and then claim for a refund, they still considered to have isActive true in their entitlement.
To check that - When I start the app (in the appDelegate), I use the PurchasesDelegate to check what the current status of the user when he enters the app:
if purchaserInfo.entitlements[Constants.entitlementID]?.isActive == true {
// USER IS PREMIUM
} else {
// USER IS NOT PREMIUM
}
Hence, I assume that if a user asked for a refund he will no longer be entitled to be active, but I can see that users are still getting isActive true.
What am I doing wrong? Is anyone else encountered that?
Or, is there other if statement that I can do which is more accurate?
The delegate method is called when PurchaserInfo is updated locally from another method (like fetching PurchaserInfo as mentioned above, making a purchase, or restoring a purchase), but it won’t be called when the info is updated server-side, as we don’t push data to the client. Additionally, when the app launches, this method will be called with the ‘old’ PurchaserInfo, which could contain outdated information. It’s important to fetch new data often.
You’ll want to be sure that you are refreshing your purchaser info often by calling getPurchaserInfo. We cache purchaser info for approximately 5 minutes, so as long as you continue refreshing and don’t store the purchaser info locally, the user will lose access after a refund.
We don’t ever push data to clients, so you’ll need to be sure you are refreshing as purchaser info won’t update automatically (except after an app launch or a new purchase).
I guess getPurchaserInfo is the purchaserInfo object (as there’s no method getPurchaserInfo in Swift.).
I’m using the purchaserInfo in the didReceiveUpdated delegate method
func purchases(_ purchases: Purchases, didReceiveUpdated purchaserInfo: Purchases.PurchaserInfo) {
if purchaserInfo.entitlements[Constants.entitlementID]?.isActive == true {
// USER IS PREMIUM
} else {
// USER IS NOT PREMIUM
}
}
I’m calling it on the app launch (AppDelegeate), and never store it locally. And yet, I can still see users who claimed for a refund stay premium on app launch (a way after 5 minutes).
Can you double check that refunded users’ entitlement is not getting isActive true ?
The delegate method is called when PurchaserInfo is updated locally from another method (like fetching PurchaserInfo as mentioned above, making a purchase, or restoring a purchase), but it won’t be called when the info is updated server-side, as we don’t push data to the client. Additionally, when the app launches, this method will be called with the ‘old’ PurchaserInfo, which could contain outdated information. It’s important to fetch new data often.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.