Read the iPhone's own name for its host and tailnet node

This commit is contained in:
Ian Gulliver
2026-10-22 09:25:15 -07:00
parent fedd4ad673
commit 08fe45814e
4 changed files with 9 additions and 2 deletions
+4 -1
View File
@@ -4,6 +4,9 @@ import HTTPTypes
import OpenAPIRuntime
import OpenAPIURLSession
import os
#if os(iOS)
import UIKit
#endif
let log = Logger(subsystem: "run.fc.byre.mac", category: "byre")
@@ -104,7 +107,7 @@ private let clientID = newID("cli")
#if os(macOS)
let deviceName = Host.current().localizedName ?? ProcessInfo.processInfo.hostName
#else
let deviceName = deviceKind
let deviceName = MainActor.assumeIsolated { UIDevice.current.name }
#endif
final class API: Sendable {
+2
View File
@@ -3,6 +3,8 @@ import SwiftUI
final class PhoneDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
// deviceName reads UIDevice, which is main-actor only, so it must first be read here.
_ = deviceName
Notifier.shared.install()
UITextView.appearance().textContainerInset = .zero
return true