You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
This is a production bug where users who have previously been subscribed still have access to all Pro features due to customerInfo.activeSubscriptions returning all productIdentifiers of previous subscriptions.
Also customerInfo.entitlements always returns value.
ENTITLEMENTS ["pro": <EntitlementInfo: "
ACTIVE SUBS ["com.appname.com.promonthly", "com.appname.com.proyearly"]
I have tried using
customerInfo.entitlements.active
But I get the same result.
I have also tried removing cached info with
Purchases.shared.invalidateCustomerInfoCache()
Also when opening Debug > StoreKit, not transactions are show.
This is the code to verify the subscription status.
func verifyIAPReceipt() {
Purchases.shared.invalidateCustomerInfoCache()
Purchases.shared.getCustomerInfo { (customerInfo, error) in
if error == nil {
if let customerInfo = customerInfo {
if customerInfo.entitlements.active.isEmpty {
print("ENTITLEMENTS IS EMPTY") <-- This is not executed
self.unsubscribe()
} else {
print("ENTITLEMENTS IS NOT EMPTY") <-- Executed
print("ENTITLEMENTS \(customerInfo.entitlements)")
print("ACTIVE SUBS \(customerInfo.activeSubscriptions)")
if customerInfo.activeSubscriptions.isEmpty == false {
print("Active Subscriptions is NOT empty") <-- Executed
for s in customerInfo.activeSubscriptions {
if s == "com.app.come.promonthly" || s == "com.app.com.proyearly" {
subscribe() <-- Executed Unlocks features
}
}
} else if customerInfo.activeSubscriptions.isEmpty == true {
print("Active Subscriptions are empty")
self.unsubscribe()
} else {
print("Active Subscription and profile is subscribed")
}
}
}
} else {
print("ERROR GETTING CUSTOMER INFO TO VERIFY RECEIPTS")
}
}
}
When using fetchPolicy: .fetchCurrent it is returning active subscriptions
Purchases.shared.getCustomerInfo(fetchPolicy: .fetchCurrent, completion: { (customerInfo, error) in
if error != nil {
print("FETCH POLICY ERROR:\(error)")
}
if customerInfo != nil {
print("FETCH POLICY ACTIVE SUBSCRIPTIONS:\(customerInfo!.activeSubscriptions)")
print("FETCH POLICY ACTIVE ENTITLEMENTS:\(customerInfo!.entitlements)")
print("FETCH POLICY ACTIVE ALL PURCHASED PRODUCT ID'S:\(customerInfo!.allPurchasedProductIdentifiers)")
}
})
Output
FETCH POLICY ACTIVE ENTITLEMENTS:["pro": <EntitlementInfo: "
FETCH POLICY ACTIVE ENTITLEMENTS:<RCEntitlementInfos: self.all=[:],
Describe the bug
This is a production bug where users who have previously been subscribed still have access to all Pro features due to
customerInfo.activeSubscriptions
returning allproductIdentifiers
of previous subscriptions.Also
customerInfo.entitlements
always returns value.I have added
This returns
I have tried using
But I get the same result.
I have also tried removing cached info with
Also when opening Debug > StoreKit, not transactions are show.
This is the code to verify the subscription status.
When using
fetchPolicy: .fetchCurrent
it is returning active subscriptionsOutput
This is the subscribe code
I have tested via simulator and on device.
https://stackoverflow.com/questions/78743165/revenuecat-checking-subscription-status-always-returns-active
usesStoreKit2IfAvailable(true)
)Purchases.logLevel = .verbose
will help us debug this issue.Please fill in
Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: