This repository has been archived by the owner on Mar 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
PWL-122: Paywalls footer, fonts, and fixes #307
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4b803b7
PWL-122: Paywalls footer, fonts, and fixes
joshdholtz 62181d3
Forgot to update a variable
joshdholtz ba25f5e
Fixed lint issue
joshdholtz b484942
Update docs_source/🚀 Getting Started/displaying-products/paywalls.md
joshdholtz 6924500
Update code_blocks/🚀 Getting Started/displaying-products/paywalls/pay…
joshdholtz b291ba1
Update code_blocks/🚀 Getting Started/displaying-products/paywalls/pay…
joshdholtz b571694
Merge branch 'main' into pwl-122-paywall-fixes-footer-and-fonts
joshdholtz e1c852a
Merge branch 'main' into pwl-122-paywall-fixes-footer-and-fonts
joshdholtz 1ba0baa
Merge branch 'main' into pwl-122-paywall-fixes-footer-and-fonts
joshdholtz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 10 additions & 21 deletions
31
code_blocks/🚀 Getting Started/displaying-products/paywalls/paywalls_6.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,19 @@ | ||
import UIKit | ||
import SwiftUI | ||
|
||
import RevenueCat | ||
import RevenueCatUI | ||
|
||
class ViewController: UIViewController { | ||
struct YourPaywall: View { | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
let paywallView = PaywallView(mode: .condensedCard) // or .card | ||
paywall.delegate = self | ||
|
||
let hostingController = UIHostingController(rootView: paywallView) | ||
|
||
addChild(hostingController) | ||
view.addSubview(hostingController.view) | ||
hostingController.didMove(toParent: self) | ||
} | ||
|
||
} | ||
|
||
extension ViewController: PaywallViewControllerDelegate { | ||
|
||
func paywallViewController(_ controller: PaywallViewController, | ||
didFinishPurchasingWith customerInfo: CustomerInfo) { | ||
let offering: Offering | ||
|
||
var body: some View { | ||
ScrollView { | ||
// Your custom paywall design content | ||
} | ||
.paywallFooter(offering: offering, condensed: true) { customerInfo in | ||
// Purchase completed! Thank your user and dismiss your paywall | ||
} | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
code_blocks/🚀 Getting Started/displaying-products/paywalls/paywalls_7.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import SwiftUI | ||
|
||
import RevenueCat | ||
import RevenueCatUI | ||
|
||
struct App: View { | ||
var body: some View { | ||
ContentView() | ||
.presentPaywallIfNeeded( | ||
fonts: CustomPaywallFontProvider(fontName: "Arial") | ||
) { customerInfo in | ||
// Returning `true` will present the paywall | ||
return customerInfo.entitlements.active.keys.contains("pro") | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
code_blocks/🚀 Getting Started/displaying-products/paywalls/paywalls_8.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import SwiftUI | ||
|
||
import RevenueCat | ||
import RevenueCatUI | ||
|
||
struct App: View { | ||
var body: some View { | ||
ContentView() | ||
.presentPaywallIfNeeded( | ||
fonts: RoundedSystemFontProvider() | ||
) { customerInfo in | ||
// Returning `true` will present the paywall | ||
return customerInfo.entitlements.active.keys.contains("pro") | ||
} | ||
} | ||
} | ||
|
||
class RoundedSystemFontProvider: PaywallFontProvider { | ||
func font(for textStyle: Font.TextStyle) -> Font { | ||
return Font.system(textStyle, design: .rounded) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice