Skip to main content

Hi guys,

 

We’re having issues with the purchase callback never being called for some users. This post came closest to the same issue, but didn’t have a clear answer to how to resolve or what the cause could be.

The annoying this is that I can’t reproduce the issue. What happens for certain users, is that they hit our “Subscribe” button, and the loading icon that’s shown gets stuck because the callback never returns. This issue has to have to do with the call to func purchase(package: Package, completion: @escaping PurchaseCompletedBlock) , since in all other cases the loading icon would disappear.

 

Relevant Code

PurchasesManager

PurchasesManager is a wrapper Singleton class for called RevenueCat’s Purchases.

/// Purchase the given package and call completion upon result

func purchase(package: Package, completion: @escaping (StoreTransaction?, CustomerInfo?, PublicError?, Bool, Bool) -> Void) {

    if (configured) {

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

            completion(transaction, customerInfo, error, userCancelled, true)

        }

    } else {

        completion(nil, nil, nil, false, /* PurchasesManager was not configured with user email yet: */ false)

    }

}

 

And where the loading icon hangs when purchase is called:

func purchasePremium(package: Package?) {

    if let package = package {

        showLoader = true

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

            showLoader = false

            // Do other stuff (setting variables, success/error messages etc)

        }

    }

}

 

Other relevant info

I’m using SPM to install RevenueCat from Github, “Up To Next Major Version” Dependency rule set to 4.0.0 < 5.0.0

 

Any help on this would be greatly appreciated, since this is obviously affecting our conversion rates for getting people to subscribe.

 

Hope to hear back soon!

Hey @JornTheWhiteUnicorn!

We had a couple of deadlocks that we fixed in recent versions: https://github.com/RevenueCat/purchases-ios/releases

Can you try updating to the latest, and letting us know in a support ticket if you’re still seeing this issue once the users have updated?


Hey @JornTheWhiteUnicorn!

We had a couple of deadlocks that we fixed in recent versions: https://github.com/RevenueCat/purchases-ios/releases

Can you try updating to the latest, and letting us know in a support ticket if you’re still seeing this issue once the users have updated?

Thanks Cody. I’ve updated to 4.18.0 and will keep you posted.


Hey @JornTheWhiteUnicorn.

 

I’m in 4.19.0 installed with SPM, and I have the same issue.

I traced the call flow up to this point.

 

I always have Purchases.shared.purchase(package: package) { erouter] … to call a callback for errors, but not for success completion.

Minimum iOS version set for my project is 12.0.


@puppod Yep, I upgraded to 4.19.0, but still experiencing the same issue. I’m in contact with support about this. Thanks for sending your debug results, might be helpful!

 

For now, to not disturb our users too much, I created a thread that retrieves the customer info from RevenueCat every X seconds, and removes the loading icon and moves the user ahead with a success message, to not let this issue disturb the user experience too much. Retrieving the info from RevenueCat works, so the purchase is stored correctly, for some reason the callback is just not called. Just mentioning it here, so you can also use this workaround if necessary to not negatively impact users too much.


Hey @JornTheWhiteUnicorn!

We had a couple of deadlocks that we fixed in recent versions: https://github.com/RevenueCat/purchases-ios/releases

Can you try updating to the latest, and letting us know in a support ticket if you’re still seeing this issue once the users have updated?

Thanks Cody. I’ve updated to 4.18.0 and will keep you posted.

@cody the same issue still persists with 4.18.0. I’m in touch with support about this as well, but wanted to let you know about it as well.

In the meantime I’ve created a workaround to not impact our users (see my other reply), but obviously I’d preferably not want to have to do that.


@JornTheWhiteUnicorn 

I managed to make it work.

Step 1: Purchases.shared.finishTransactions = false

Step 2:

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

            if let transaction = transaction?.sk1Transaction {

                SKPaymentQueue.default().finishTransaction(transaction)

            }


@JornTheWhiteUnicorn

I managed to make it work.

Step 1: Purchases.shared.finishTransactions = false

Step 2:

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

            if let transaction = transaction?.sk1Transaction {

                SKPaymentQueue.default().finishTransaction(transaction)

            }

I have the same problem and i have managed to solve like you


Reply