superwall / Superwall-iOS

Remotely configure every aspect of your paywall and double your revenue.
https://superwall.com
MIT License
86 stars 23 forks source link

[BUG] SwiftUI Sample App Blocking Bug, Paywall Not Displayed when Purchase Controller Implemented #118

Closed seth35us closed 1 year ago

seth35us commented 1 year ago

New issue checklist

General information

Describe the bug

A clear and concise description of what the bug is. The more detail you can provide the faster our team will be able to triage and resolve the issue.

Steps to reproduce

Please also include a description of expected vs. actual behaviour

  1. Uncomment code in SwiftUI sample project to enable the purchaseController.
  2. From a fresh install click the "Track event" button.
    • Expected, a paywall will display
    • Actual, no paywall is displayed

Other Information

e.g. stacktraces, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.

jakemor commented 1 year ago

Most likely Superwall.shared.subscriptionState is .unknown – can you confirm you uncommented the following in SuperwallService.swift?

27  Task {
28    await StoreKitService.shared.loadSubscriptionState()
29  }

If you decide to manage purchasing on your own, you also must make sure this value is kept up to date

seth35us commented 1 year ago

You are correct. I was missing that code. This was really well documented in retrospect. Sorry for the non-issue.