Skip to main content

I have 2 products in the AppStore: a monthly subscription and a yearly subscription, and I am testing the RevenueCat API in sandbox.

the purchase function (Purchases.shared.purchase(package: package)) seems to be working fine, there’s no error.

I’ve tested a scenario where I buy a monthly subscription, and then a yearly subscription right after, the purchase function returns the CustomerInfo with old info (still the productIdentifier pointing to the monthly subscription). However, Purchases.shared.restorePurchases actually return the up to date CustomerInfo with the yearly subscription.

Here’s the code I’m using to purchase:

static func purchase(package: Package, completion: @escaping (_ info: CustomerInfo?, _ error: Error?, _ usercancelled: Bool) -> Void) {

        

        Purchases.shared.purchase(package: package) { transaction, customerInfo, error, userCancelled in

            completion(customerInfo, error, userCancelled)

        }

    }

 

Could it be a bug or is there something wrong with my code?

Be the first to reply!

Reply