I am trying to implement InAppPurchases into SwiftUI application.
None of what I found worked fine for me.
As I understand all IAP guides for UIKit do not work with SwiftUI as they are based on UIView delegates which would not work with SwiftUI.
So in SwiftUI, how would you connect the user input to the purchase/restore functions, etc?
While I don't have a guide, I do have some suggestions.
As I work with SwiftUI, I'm finding that it really enforces separation of UI from app logic. In the past, it was easy to muddle the two together in UIViews and UIViewControllers. Now, you have to clearly separate it out.
So I would suggest the following:
Button whose action calls your manager's function to purchase your IAP.It should provide simple functionality for you. If you care about having an activity spinner or something like that, then you can implement those later. But otherwise, this should get you started.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With