mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
* Initial plan * Add Background Activity onboarding step, firmware version screens, and security nag Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/449fe2d6-dec9-4509-920e-e6196ca11d65 Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com> * Address code review feedback: use @ObservedObject for LocationsHandler, fix firmware label Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/449fe2d6-dec9-4509-920e-e6196ca11d65 Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com> * Improve readability of firmware version checks in Connect.swift Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/449fe2d6-dec9-4509-920e-e6196ca11d65 Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com> * Add Siri onboarding step; fix @State→let in version sheets; fix .denied location flow Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/654a5abf-8005-4995-974a-5f1f95dfa68a Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com> * Update protobufs package * Additional onboarding cleanup * Catalyst fixes --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com> Co-authored-by: Garth Vander Houwen <garthvh@yahoo.com>
110 lines
3 KiB
Swift
110 lines
3 KiB
Swift
//
|
|
// InvalidVersion.swift
|
|
// Meshtastic
|
|
//
|
|
// Copyright(c) Garth Vander Houwen 7/13/22.
|
|
//
|
|
import SwiftUI
|
|
|
|
struct InvalidVersion: View {
|
|
|
|
@Environment(\.dismiss) private var dismiss
|
|
|
|
let minimumVersion: String
|
|
let version: String
|
|
|
|
var body: some View {
|
|
VStack(spacing: 0) {
|
|
ScrollView {
|
|
VStack(spacing: 20) {
|
|
Image(systemName: "exclamationmark.triangle.fill")
|
|
.font(.system(size: 60))
|
|
.foregroundColor(.orange)
|
|
.padding(.top, 40)
|
|
|
|
Text("Firmware Update Required")
|
|
.font(.largeTitle.bold())
|
|
.multilineTextAlignment(.center)
|
|
.fixedSize(horizontal: false, vertical: true)
|
|
|
|
VStack(spacing: 8) {
|
|
if !version.isEmpty {
|
|
Label {
|
|
Text("Connected firmware: **\(version)**")
|
|
} icon: {
|
|
Image(systemName: "wifi.slash")
|
|
.foregroundColor(.red)
|
|
}
|
|
.font(.body)
|
|
}
|
|
Label {
|
|
Text("Minimum required: **\(minimumVersion)**")
|
|
} icon: {
|
|
Image(systemName: "checkmark.shield.fill")
|
|
.foregroundColor(.green)
|
|
}
|
|
.font(.body)
|
|
}
|
|
.padding()
|
|
.background(Color(.secondarySystemBackground))
|
|
.cornerRadius(12)
|
|
|
|
Text("The Meshtastic Apple app requires firmware version \(minimumVersion) or later. Older firmware versions are no longer supported and may have compatibility issues or missing features.")
|
|
.font(.body)
|
|
.foregroundColor(.secondary)
|
|
.multilineTextAlignment(.center)
|
|
.fixedSize(horizontal: false, vertical: true)
|
|
.padding(.horizontal)
|
|
|
|
VStack(alignment: .leading, spacing: 12) {
|
|
Text("How to Update")
|
|
.font(.headline)
|
|
Link(destination: URL(string: "https://flasher.meshtastic.org")!) {
|
|
Label("Open Web Flasher", systemImage: "bolt.fill")
|
|
.frame(maxWidth: .infinity)
|
|
}
|
|
.buttonStyle(.borderedProminent)
|
|
.controlSize(.regular)
|
|
.buttonBorderShape(.capsule)
|
|
Link(destination: URL(string: "https://meshtastic.org/docs/getting-started/flashing-firmware/")!) {
|
|
Label("Firmware Update Docs", systemImage: "book.fill")
|
|
.frame(maxWidth: .infinity)
|
|
}
|
|
.buttonStyle(.bordered)
|
|
.controlSize(.regular)
|
|
.buttonBorderShape(.capsule)
|
|
Link(destination: URL(string: "https://meshtastic.org/docs/faq")!) {
|
|
Label("Additional Help", systemImage: "questionmark.circle.fill")
|
|
.frame(maxWidth: .infinity)
|
|
}
|
|
.buttonStyle(.bordered)
|
|
.controlSize(.regular)
|
|
.buttonBorderShape(.capsule)
|
|
}
|
|
.padding()
|
|
.background(Color(.secondarySystemBackground))
|
|
.cornerRadius(12)
|
|
.padding(.horizontal)
|
|
}
|
|
.padding(.bottom, 20)
|
|
}
|
|
|
|
#if targetEnvironment(macCatalyst)
|
|
Button {
|
|
dismiss()
|
|
} label: {
|
|
Label("Close", systemImage: "xmark")
|
|
.frame(maxWidth: .infinity)
|
|
}
|
|
.buttonStyle(.borderedProminent)
|
|
.buttonBorderShape(.capsule)
|
|
.controlSize(.large)
|
|
.padding()
|
|
#endif
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
InvalidVersion(minimumVersion: "2.5.4", version: "2.3.0")
|
|
}
|