Add 'apps/mobile/' from commit '5fa30f365f21531094cd4d2045042bb4f1370ac3'

git-subtree-dir: apps/mobile
git-subtree-mainline: 86f8987dff
git-subtree-split: 5fa30f365f
This commit is contained in:
2026-08-16 21:42:59 -04:00
222 changed files with 23436 additions and 0 deletions
@@ -0,0 +1,8 @@
import UIKit
enum BeenVoiceIntentHelpers {
@MainActor
static func openDeepLink(_ url: URL) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
}
@@ -0,0 +1,36 @@
import AppIntents
struct BeenVoiceShortcuts: AppShortcutsProvider {
@AppShortcutsBuilder
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: ClockInIntent(),
phrases: [
"Clock in with \(.applicationName)",
"Start timer in \(.applicationName)",
"Start tracking time in \(.applicationName)",
],
shortTitle: "Clock In",
systemImageName: "play.circle.fill"
)
AppShortcut(
intent: ClockOutIntent(),
phrases: [
"Clock out in \(.applicationName)",
"Stop timer in \(.applicationName)",
"Stop tracking time in \(.applicationName)",
],
shortTitle: "Clock Out",
systemImageName: "stop.circle.fill"
)
AppShortcut(
intent: OpenTimerIntent(),
phrases: [
"Open time clock in \(.applicationName)",
"Open timer in \(.applicationName)",
],
shortTitle: "Time Clock",
systemImageName: "timer"
)
}
}
@@ -0,0 +1,31 @@
import AppIntents
struct ClockInIntent: AppIntent {
static var title: LocalizedStringResource = "Clock In"
static var description = IntentDescription("Start the beenvoice time clock with your last client.")
static var openAppWhenRun: Bool = true
static var isDiscoverable: Bool = true
@Parameter(title: "Title")
var title: String?
@MainActor
func perform() async throws -> some IntentResult {
var components = URLComponents()
components.scheme = "beenvoice"
components.host = "shortcuts"
components.path = "/clock-in"
if let title, !title.isEmpty {
components.queryItems = [URLQueryItem(name: "title", value: title)]
}
guard let url = components.url else {
return .result()
}
BeenVoiceIntentHelpers.openDeepLink(url)
return .result()
}
}
@@ -0,0 +1,19 @@
import AppIntents
struct ClockOutIntent: AppIntent {
static var title: LocalizedStringResource = "Clock Out"
static var description = IntentDescription("Stop the running beenvoice timer and save your time.")
static var openAppWhenRun: Bool = true
static var isDiscoverable: Bool = true
@MainActor
func perform() async throws -> some IntentResult {
guard let url = URL(string: "beenvoice://shortcuts/clock-out") else {
return .result()
}
BeenVoiceIntentHelpers.openDeepLink(url)
return .result()
}
}
@@ -0,0 +1,19 @@
import AppIntents
struct OpenTimerIntent: AppIntent {
static var title: LocalizedStringResource = "Open Time Clock"
static var description = IntentDescription("Open the beenvoice time clock.")
static var openAppWhenRun: Bool = true
static var isDiscoverable: Bool = true
@MainActor
func perform() async throws -> some IntentResult {
guard let url = URL(string: "beenvoice://timer") else {
return .result()
}
BeenVoiceIntentHelpers.openDeepLink(url)
return .result()
}
}