Skip to main content
Solved

How to add user authentication check before purchase button clicked

  • 25 August 2024
  • 2 replies
  • 14 views

Hi RevenueCat, I would appreciate some help here. I am developing an app in SwiftUI for iOS and using the RevenueCatUI PaywallView to display offers. 

When the paywall presents itself to the user, I would like to verify if the user has made an account with the app before allowing the purchase.

Can you advise on how to make this change without altering the package dependency itself? I would ideally like to make an extension of the PayWallView or a superclass “CustomPayWallView” with custom functionality, but it is a lot of code to read through and edit.

I understand if this is a big ask, but any pointing in the right direction would be a great help. Thank you!

 

Edit: I would also appreciate a link to the PayWallView API Reference, I can’t seem to find one. Thanks!

Hi, it sounds like right now you are using anonymous ids until the user creates an account where you then use custom ids correct? If that is the case then when the user tries to access your paywall page, you can force the user to login by checking to see if they are an anonymous id and if they are then force them to create an account. 


I would have ideally liked for the user to be able to see the paywall before being forced to make an account, but I don’t think this is possible after going through the code. That being said, this is the right approach. Thanks!