Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,115 changes: 53 additions & 2,062 deletions LoopFollow.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions LoopFollow/Alarm/SnoozeState.swift

This file was deleted.

31 changes: 0 additions & 31 deletions LoopFollow/BackgroundRefresh/BT/DexcomG7HeartBeat.swift

This file was deleted.

31 changes: 0 additions & 31 deletions LoopFollow/Extensions/HKQuantity+AnyConvertible.swift

This file was deleted.

68 changes: 38 additions & 30 deletions LoopFollow/LiveActivity/RestartLiveActivityIntent.swift
Original file line number Diff line number Diff line change
@@ -1,39 +1,47 @@
// LoopFollow
// RestartLiveActivityIntent.swift

import AppIntents
import UIKit

struct RestartLiveActivityIntent: AppIntent {
static var title: LocalizedStringResource = "Restart Live Activity"
static var description = IntentDescription("Starts or restarts the LoopFollow Live Activity.")

func perform() async throws -> some IntentResult & ProvidesDialog {
Storage.shared.laEnabled.value = true

let keyId = Storage.shared.lfKeyId.value
let apnsKey = Storage.shared.lfApnsKey.value
#if !targetEnvironment(macCatalyst)
import AppIntents
import UIKit

@available(iOS 16.4, *)
struct RestartLiveActivityIntent: AppIntent, ForegroundContinuableIntent {
static var title: LocalizedStringResource = "Restart Live Activity"
static var description = IntentDescription("Starts or restarts the LoopFollow Live Activity.")

func perform() async throws -> some IntentResult & ProvidesDialog {
Storage.shared.laEnabled.value = true

let keyId = Storage.shared.lfKeyId.value
let apnsKey = Storage.shared.lfApnsKey.value

if keyId.isEmpty || apnsKey.isEmpty {
if let url = URL(string: "loopfollow://settings/live-activity") {
await MainActor.run { UIApplication.shared.open(url) }
}
return .result(dialog: "Please enter your APNs credentials in LoopFollow settings to use the Live Activity.")
}

if keyId.isEmpty || apnsKey.isEmpty {
if let url = URL(string: "\(AppGroupID.urlScheme)://settings/live-activity") {
await MainActor.run { UIApplication.shared.open(url) }
if #available(iOS 26.0, *) {
try await continueInForeground()
}
return .result(dialog: "Please enter your APNs credentials in LoopFollow settings to use the Live Activity.")
}

await MainActor.run { LiveActivityManager.shared.forceRestart() }
await MainActor.run { LiveActivityManager.shared.forceRestart() }

return .result(dialog: "Live Activity restarted.")
return .result(dialog: "Live Activity restarted.")
}
}
}

struct LoopFollowAppShortcuts: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: RestartLiveActivityIntent(),
phrases: ["Restart Live Activity in \(.applicationName)"],
shortTitle: "Restart Live Activity",
systemImageName: "dot.radiowaves.left.and.right",
)

@available(iOS 16.4, *)
struct LoopFollowAppShortcuts: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: RestartLiveActivityIntent(),
phrases: ["Restart Live Activity in \(.applicationName)"],
shortTitle: "Restart Live Activity",
systemImageName: "dot.radiowaves.left.and.right"
)
}
}
}
#endif

This file was deleted.

8 changes: 0 additions & 8 deletions LoopFollow/ViewControllers/AppStateViewController.swift

This file was deleted.

47 changes: 0 additions & 47 deletions RestartLiveActivityIntent.swift

This file was deleted.

File renamed without changes.
Loading