mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
App Review requires a privacy policy link inside the app. The Privacy page now has a card with two rows between Learn how I type and Advanced: - Privacy policy opens https://dev.anoma.ly/hex/privacy. - Support opens https://dev.anoma.ly/hex/iphone. Both open in Safari inside Hex (SFSafariViewController, SafariSheet). The URLs come from one base in HexLinks.swift (HexLinks.site). Moving to https://anoma.ly/hex is a one-line change once the site's production deploy serves those pages; https://anoma.ly/hex/privacy returns 404 today, while both dev.anoma.ly pages return 200. README's Privacy page entry says so. Verified: the build passes on an iPhone 18 Pro simulator (iOS 27.2). I looked at the settings-privacy render. A temporary, uncommitted hook opened the Privacy policy row's Safari sheet, which loaded the live dev.anoma.ly page.
27 lines
1.1 KiB
Swift
27 lines
1.1 KiB
Swift
import SafariServices
|
|
import UIKit
|
|
|
|
/// Hex's web pages for the iPhone app, under one base so they can move to
|
|
/// `https://anoma.ly/hex` once the site's production deploy serves them (it 404s until then).
|
|
enum HexLinks {
|
|
static let site = URL(string: "https://dev.anoma.ly/hex")!
|
|
static let privacyPolicy = site.appending(path: "privacy")
|
|
static let support = site.appending(path: "iphone")
|
|
}
|
|
|
|
/// Opens a web page in Safari inside Hex (`SFSafariViewController`), over whatever is showing.
|
|
@MainActor
|
|
enum SafariSheet {
|
|
static func present(_ url: URL) {
|
|
let scene = UIApplication.shared.connectedScenes
|
|
.compactMap { $0 as? UIWindowScene }
|
|
.first { $0.activationState == .foregroundActive }
|
|
guard var top = scene?.keyWindow?.rootViewController else { return }
|
|
while let presented = top.presentedViewController, !presented.isBeingDismissed {
|
|
top = presented
|
|
}
|
|
let controller = SFSafariViewController(url: url)
|
|
controller.overrideUserInterfaceStyle = .dark
|
|
top.present(controller, animated: true)
|
|
}
|
|
}
|