1.2.2 - "Bug fixes and improvements"
This commit is contained in:
@@ -9,7 +9,7 @@ struct LiveActivityDebugView: View {
|
||||
@State private var isTestRunning = false
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
NavigationStack {
|
||||
VStack(alignment: .leading, spacing: 20) {
|
||||
|
||||
// Header
|
||||
@@ -87,7 +87,7 @@ struct LiveActivityDebugView: View {
|
||||
.disabled(dataManager.activeSession == nil)
|
||||
|
||||
if dataManager.gyms.isEmpty {
|
||||
Text("⚠️ Add at least one gym to test Live Activities")
|
||||
Text("WARNING: Add at least one gym to test Live Activities")
|
||||
.font(.caption)
|
||||
.foregroundColor(.orange)
|
||||
}
|
||||
@@ -167,29 +167,31 @@ struct LiveActivityDebugView: View {
|
||||
}
|
||||
|
||||
private func checkStatus() {
|
||||
appendDebugOutput("🔍 Checking Live Activity status...")
|
||||
appendDebugOutput("Checking Live Activity status...")
|
||||
|
||||
let status = LiveActivityManager.shared.checkLiveActivityAvailability()
|
||||
appendDebugOutput("Status: \(status)")
|
||||
|
||||
// Check iOS version
|
||||
if #available(iOS 16.1, *) {
|
||||
appendDebugOutput("✅ iOS version supports Live Activities")
|
||||
appendDebugOutput("iOS version supports Live Activities")
|
||||
} else {
|
||||
appendDebugOutput("❌ iOS version does not support Live Activities (requires 16.1+)")
|
||||
appendDebugOutput(
|
||||
"ERROR: iOS version does not support Live Activities (requires 16.1+)")
|
||||
}
|
||||
|
||||
// Check if we're on simulator
|
||||
#if targetEnvironment(simulator)
|
||||
appendDebugOutput("⚠️ Running on Simulator - Live Activities have limited functionality")
|
||||
appendDebugOutput(
|
||||
"WARNING: Running on Simulator - Live Activities have limited functionality")
|
||||
#else
|
||||
appendDebugOutput("✅ Running on device - Live Activities should work fully")
|
||||
appendDebugOutput("Running on device - Live Activities should work fully")
|
||||
#endif
|
||||
}
|
||||
|
||||
private func testLiveActivity() {
|
||||
guard !dataManager.gyms.isEmpty else {
|
||||
appendDebugOutput("❌ No gyms available for testing")
|
||||
appendDebugOutput("ERROR: No gyms available for testing")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -240,25 +242,25 @@ struct LiveActivityDebugView: View {
|
||||
appendDebugOutput("Ending Live Activity...")
|
||||
await LiveActivityManager.shared.endLiveActivity()
|
||||
|
||||
appendDebugOutput("🏁 Live Activity test completed!")
|
||||
appendDebugOutput("Live Activity test completed!")
|
||||
}
|
||||
}
|
||||
|
||||
private func endCurrentSession() {
|
||||
guard let activeSession = dataManager.activeSession else {
|
||||
appendDebugOutput("❌ No active session to end")
|
||||
appendDebugOutput("ERROR: No active session to end")
|
||||
return
|
||||
}
|
||||
|
||||
appendDebugOutput("🛑 Ending current session: \(activeSession.id)")
|
||||
appendDebugOutput("Ending current session: \(activeSession.id)")
|
||||
dataManager.endSession(activeSession.id)
|
||||
appendDebugOutput("✅ Session ended")
|
||||
appendDebugOutput("Session ended")
|
||||
}
|
||||
|
||||
private func forceLiveActivityUpdate() {
|
||||
appendDebugOutput("🔄 Forcing Live Activity update...")
|
||||
appendDebugOutput("Forcing Live Activity update...")
|
||||
dataManager.forceLiveActivityUpdate()
|
||||
appendDebugOutput("✅ Live Activity update sent")
|
||||
appendDebugOutput("Live Activity update sent")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user