Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Message on "Try Beta" when already in TF #2351

Merged
merged 2 commits into from
Oct 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Classes/Settings/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,13 @@ NewIssueTableViewControllerDelegate {
}

func onTryTestFlightBeta() {
#if TESTFLIGHT
Squawk.showAlreadyOnBeta()
#else
guard let url = URL(string: "https://testflight.apple.com/join/QIVXLkkn")
else { fatalError("Failed to decode testflight beta URL") }
presentSafari(url: url)
#endif
}

func onSignOut() {
Expand Down
16 changes: 16 additions & 0 deletions Classes/Systems/Squawk+GitHawk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ extension Squawk {
)
}

static func showAlreadyOnBeta(view: UIView? = window) {
let config = Squawk.Configuration(
text: NSLocalizedString("You're are already using a TestFlight build. 👌", comment: ""),
backgroundColor: UIColor.black.withAlphaComponent(0.5),
insets: UIEdgeInsets(
top: Styles.Sizes.rowSpacing,
left: Styles.Sizes.gutter,
bottom: Styles.Sizes.rowSpacing,
right: Styles.Sizes.gutter
),
hintMargin: Styles.Sizes.rowSpacing
)
Squawk.shared.show(in: view, config: config)
triggerHaptic()
}

static func showRevokeError(view: UIView? = window) {
Squawk.shared.show(in: view, config: errorConfig(text: NSLocalizedString("Your access token was revoked.", comment: "")))
triggerHaptic()
Expand Down