iOS Release - 1.0.1

This commit is contained in:
2025-09-20 12:03:37 -06:00
parent 7c18b56674
commit 0235b5d506
6 changed files with 167 additions and 102 deletions

View File

@@ -87,16 +87,28 @@ final class LiveActivityManager {
/// Call this when a ClimbSession ends to end the Live Activity
func endLiveActivity() async {
guard let currentActivity else {
print(" No current activity to end")
return
// First end the tracked activity if it exists
if let currentActivity {
print("🔴 Ending tracked Live Activity: \(currentActivity.id)")
await currentActivity.end(nil, dismissalPolicy: .immediate)
self.currentActivity = nil
print("✅ Tracked Live Activity ended successfully")
}
print("🔴 Ending Live Activity: \(currentActivity.id)")
// Force end ALL active activities of our type to ensure cleanup
print("🔍 Checking for any remaining active activities...")
let activities = Activity<SessionActivityAttributes>.activities
await currentActivity.end(nil, dismissalPolicy: .immediate)
self.currentActivity = nil
print("✅ Live Activity ended successfully")
if activities.isEmpty {
print(" No additional activities found")
} else {
print("🔴 Found \(activities.count) additional active activities, ending them...")
for activity in activities {
print("🔴 Force ending activity: \(activity.id)")
await activity.end(nil, dismissalPolicy: .immediate)
}
print("✅ All Live Activities ended successfully")
}
}
/// Check if Live Activities are available and authorized