Add local Bell and screen-awake controls with per-session bell observation and scene-aware effects. Provide foreground Connection Journey success haptics independent of terminal preferences. Replace the notification sound with an original bell resource, make AudioToolbox completion queue-safe, and group mobile theme settings.
20 lines
565 B
Swift
20 lines
565 B
Swift
import UIKit
|
|
|
|
@MainActor
|
|
enum TerminalNotificationPlatform {
|
|
static var soundURL: URL? { Bundle.main.url(forResource: "bell", withExtension: "wav") }
|
|
|
|
static func ringBell() {
|
|
guard ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"] == nil,
|
|
let url = soundURL
|
|
else { return }
|
|
MobileSystemSoundPlayer.live.play(url: url)
|
|
}
|
|
|
|
static func openSettings() {
|
|
if let url = URL(string: UIApplication.openNotificationSettingsURLString) {
|
|
UIApplication.shared.open(url)
|
|
}
|
|
}
|
|
}
|