Wednesday, September 10, 2025
HomeiOS Developmentios - RevenueCat - Checking subscription standing all the time returns energetic

ios – RevenueCat – Checking subscription standing all the time returns energetic


If a consumer has subscribed to the app however then unsubscribed, the next code nonetheless executes `subscribe()’ all the time for that system, even when the identical AppleID shouldn’t be used, with options remaining unlocked.

I’ve added

print("ENTITLEMENTS (customerInfo.entitlements)")
                        
print("ACTIVE SUBS (customerInfo.activeSubscriptions)")

When a consumer has made an iAP, that system all the time returns the next. Even after erasing system.

ENTITLEMENTS

ACTIVE SUBS [“com.appname.com.promonthly”]

I’ve additionally tried eradicating cached data with

    Purchases.shared.invalidateCustomerInfoCache()

Additionally when opening Debug > StoreKit, not transactions are present.

I’ve examined by way of simulator and on system.

func verifyIAPReceipt() {
    
    Purchases.shared.invalidateCustomerInfoCache()
   
    Purchases.shared.getCustomerInfo { (customerInfo, error) in
        if error == nil {
            if let customerInfo = customerInfo {
                
                if !customerInfo.entitlements.energetic.isEmpty {
                    
                    print("ENTITLEMENTS IS EMPTY") <-- This isn't 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("Energetic Subscriptions is NOT empty") <-- Executed
                        
                        for s in customerInfo.activeSubscriptions  {
                            if s == "com.app.come.promonthly" || s == "com.app.com.proyearly"  {
                                subscribe() <-- Executed Unlocks options
                            } 
                        }
                    } else if customerInfo.activeSubscriptions.isEmpty == true {
                        print("Energetic Subscriptions are empty")
                        self.unsubscribe()
                    } else {
                        print("Energetic Subscription and profile is subscribed")
                    }
                }
                
            }
            
            
        } else {
            print("ERROR GETTING CUSTOMER INFO TO VERIFY RECEIPTS")
        }
    }
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments