-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #288 from superwall/v4-develop
4.0.0-beta.5
- Loading branch information
Showing
43 changed files
with
804 additions
and
618 deletions.
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
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
36 changes: 0 additions & 36 deletions
36
Examples/Advanced/Advanced/Components/SuperwallEntitlementsView.swift
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
Examples/Advanced/Advanced/Components/SuperwallSubscriptionView.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,36 @@ | ||
// | ||
// SuperwallSubscriptionView.swift | ||
// SuperwallSwiftUIExample | ||
// | ||
// Created by Yusuf Tör on 15/03/2022. | ||
// | ||
|
||
import SwiftUI | ||
import SuperwallKit | ||
|
||
struct SuperwallSubscriptionView: View { | ||
@StateObject private var superwall = Superwall.shared // ensures subscriptionStatus is auto updating | ||
var text: String { | ||
// These are published properties that auto-update | ||
switch superwall.subscriptionStatus { | ||
case .unknown: | ||
return "Loading subscription status." | ||
case .inactive: | ||
return "You do not have an active subscription so a paywall will always show." | ||
case .active(let entitlements): | ||
return "You currently have an active subscription with the \(entitlements.map { $0.id }.joined(separator: " and ")) entitlement. For the purposes of this app, delete and reinstall the app to clear your transactions." | ||
} | ||
} | ||
|
||
var body: some View { | ||
Text(text) | ||
.multilineTextAlignment(.center) | ||
.lineSpacing(5) | ||
.padding() | ||
.padding(.bottom, 20) | ||
} | ||
} | ||
|
||
#Preview { | ||
SuperwallSubscriptionView() | ||
} |
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.