Universal Links: gescannter Einzelstück-Link öffnet die App

Server liefert /.well-known/apple-app-site-association (nur /i/* beansprucht;
/l/* bleibt im Browser). iOS: Associated-Domains-Entitlement, Universal Link
(https://…/i/<UID>) wird abgefangen (onContinueUserActivity) und öffnet das
Einzelstück direkt.

Hinweis: Damit das Signieren durchläuft, muss die Capability "Associated
Domains" einmalig im Apple-Developer-Portal für die App-ID aktiv sein.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Scarriffle
2026-07-26 08:12:45 +02:00
parent 7f9895245c
commit e8471bd951
6 changed files with 56 additions and 4 deletions

View File

@@ -4,6 +4,8 @@ struct RootView: View {
@EnvironmentObject private var session: Session
@EnvironmentObject private var router: Router
@EnvironmentObject private var display: DisplaySettings
/// Über einen gescannten Universal Link geöffnetes Einzelstück.
@State private var linkedItem: Item?
var body: some View {
Group {
@@ -41,6 +43,14 @@ struct RootView: View {
}
}
}
.task(id: router.openItemUid) {
guard let uid = router.openItemUid else { return }
linkedItem = try? await APIClient.shared.itemByUid(uid: uid)
router.openItemUid = nil
}
.sheet(item: $linkedItem) { it in
NavigationStack { ItemEditView(item: it) }
}
}
}