Purchasely / Purchasely-iOS

Purchasely iOS SDK
https://www.purchasely.com
Other
27 stars 0 forks source link

Error finding presentation (null). Too many calls on /configuration #7

Closed cederache closed 1 year ago

cederache commented 1 year ago

Hi, I implemented Purchasely in an app and I found that if I tap too frequently on a subscribe button (which call Purchasely.presentationController(for:, completion:)) I have the error Error finding presentation (null). Too many calls on /configuration

The view is shown but full white instead of the configured paywall.

Is there a delay needed between two calls of this function ?

Here is the code in the button IBAction :

guard let paywallCtrl = Purchasely.presentationController(for: "default_placement", completion: { [weak self] result, error in
        if let error = error {
            Logger.error("Error \(error)")
        }
        Logger.debug("Result \(result)")
    }) else {
        Logger.error("Error while getting Purchasely presentation controller")
        return
    }

    presentingViewController.present(paywallCtrl, animated: true)
mlanoy1 commented 1 year ago

Hi @cederache,

In previous version of our SDK, there is a threshold between two calls of a second but with last version 3.5.0, this has been changed to return a cache response instead of an error.

cederache commented 1 year ago

Hi @mlanoy1 It works with the 3.5.0 version of the SDK 👍

Thanks