Skip to main content

My purchasing code seems to work fine for the majority of users, but I have a small portion of them who for whatever reason either have entitlements for a period of time and then lose them, or for whom the entitlements are seemingly never granted, even though the purchase was successful.

When checking their customer info in the RC dashboard, it shows no entitlements.

Any ideas for how to troubleshoot this?

 

Here’s my code for completing a purchase:

if let package = self.offering?.availablePackagesk1] {

                Purchases.shared.purchase(package: package) { :self] (transaction, purchaserInfo, error, userCancelled) in

                    if let error = error {

                        self.present(errorAlert(message: error.localizedDescription), animated: true, completion: nil)

                    } else {

                        if purchaserInfo?.entitlements"Lifetime Access"]?.isActive == true {

                            entitlementsGranted = true

                            saveUserData()

                            self.dismiss(animated: true, completion: nil)

                        }

                    }

                }

            }

And here’s my code for logging in at app launch:

Purchases.shared.getCustomerInfo { (info, error) in

            if let error = error {

                errorMessage = error.localizedDescription

            } else {

                if info?.entitlementsb"Lifetime Access"]?.isActive == true {

                    entitlementsGranted = true

                } else if info?.entitlementse"Subscription Access"]?.isActive == true {

                    entitlementsGranted = true

                } else {

                    entitlementsGranted = false

                }

            }

        }

 

Be the first to reply!

Reply