Skip to content

Commit

Permalink
Paywalls: temporarily disable non-fullscreen PaywallViews (#2868)
Browse files Browse the repository at this point in the history
They're not quite ready yet so we don't want to show them in the sample
app.
  • Loading branch information
NachoSoto committed Aug 3, 2023
1 parent b72eb44 commit 361ca12
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Tests/TestingApps/SimpleApp/SimpleApp/Views/AppContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct AppContentView: View {
Text(verbatim: "You're signed in: \(info.originalAppUserId)")
.font(.callout)

if !info.hasPro {
if self.shouldDisplayPaywall {
PaywallView(mode: .banner)
}

Expand All @@ -35,7 +35,7 @@ struct AppContentView: View {
BarChartView(data: (0..<10).map { _ in Double.random(in: 0..<100)})
.frame(maxWidth: .infinity)

if !info.hasPro {
if self.shouldDisplayPaywall {
PaywallView(mode: .card)
} else if let date = info.latestExpirationDate {
Text(verbatim: "Your subscription expires: \(date.formatted())")
Expand All @@ -49,6 +49,14 @@ struct AppContentView: View {
}
}

private var displayNonFullScreenPaywalls: Bool {
return false
}

private var shouldDisplayPaywall: Bool {
return self.displayNonFullScreenPaywalls && self.customerInfo?.hasPro == false
}

}


Expand All @@ -60,7 +68,9 @@ struct AppContentView: View {
struct AppContentView_Previews: PreviewProvider {

static var previews: some View {
AppContentView(customerInfo: TestData.customerInfo)
NavigationStack {
AppContentView(customerInfo: TestData.customerInfo)
}
}

}
Expand Down

0 comments on commit 361ca12

Please sign in to comment.