Code Monkey home page Code Monkey logo

Comments (7)

RCGitBot avatar RCGitBot commented on June 3, 2024

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

from purchases-ios.

wyattharrell avatar wyattharrell commented on June 3, 2024

Relevant MR that added automatic dismissal of PaywallViewController on purchase event: #3517

from purchases-ios.

NachoSoto avatar NachoSoto commented on June 3, 2024

Thanks for the detailed report!

You are correct. Unfortunately there is no trivial way of doing this because a successful restore does not imply that the user has unlocked something. From our docs:
Screenshot 2024-01-31 at 09 27 54

When using presentPaywallIfNeeded we can determine if the condition to display the paywall is no longer met and dismiss it automatically on restore: https://github.com/RevenueCat/purchases-ios/blob/4.33.0/RevenueCatUI/View%2BPresentPaywall.swift#L200-L202

Therefore this likely has to be done manually from outside the SDK.

Calling controller.dismiss(animated) when receiving didFinishRestoringWith WILL dismiss the view controller, but the "Success" alert will NOT be shown

Can you share the code you're using for that?

from purchases-ios.

wyattharrell avatar wyattharrell commented on June 3, 2024

Thanks for the quick reply, appreciate the explanation. I attempted an MR for this yesterday and also learned that it is not trivial.

I am using UIKit to present the PaywallViewController. Calling dismiss on the controller when receiving didFinishRestoringWith will skip showing the UIAlertViewController that is shown after success of a restore.

func paywallViewController(_ controller: PaywallViewController, 
                           didFinishRestoringWith customerInfo: CustomerInfo) {
    controller.dismiss(animated: true)
}

from purchases-ios.

NachoSoto avatar NachoSoto commented on June 3, 2024

Thank you! I just changed how this delegation works so that .onRestoreCompleted and paywallViewController(_: didFinishRestoringWith:) are only called after the "Purchases restored" dialog disappears #3620 :)

from purchases-ios.

wyattharrell avatar wyattharrell commented on June 3, 2024

Awesome. Thank you so much @NachoSoto!

from purchases-ios.

github-actions avatar github-actions commented on June 3, 2024

This issue has been automatically locked due to no recent activity after it was closed. Please open a new issue for related reports.

from purchases-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.