Active entitlement doesn't change when upgrade to a new product

  • 7 September 2022
  • 0 replies
  • 40 views

Badge +4

I have two products (weekly, monthly) and two entitlement attached to them. In sandbox, when I purchase the first weekly, the entitlement is right. But when I upgrade to the monthly when weekly entitlement is active, active entitlement seems to be be still the weekly. I expect it to entitled to only monthly. Upon purchase of monthly debug logs show the purchased product as monthly but I can’t get its entitlement as active entitlement.
purchaseInfo.entitlements.active seems to have only one entitlement and it’s weekly. The product definitions are in the same subscription group. The sandbox data also shows the latest purchase as weekly and user’s entitlement to monthly. What could be the problem here?
I’m checking it like shown below:
 

Purchases.shared.purchase(package:selectedPackage) { transaction, purchaseInfo, error, userCancelled in
if let error = error {
print(error.localizedDescription)
self.purchaseFailed(purchaseInfo, error, userCancelled)
} else {
guard let purchaseInfo = purchaseInfo
else{return}
let activeEntitlement = purchaseInfo.entitlements.active.first?.key
}

}

Version: 4.9.0


0 replies

Be the first to reply!

Reply