// Basic configuration
do {
try portal.setPasskeyConfiguration(
relyingParty: "portalhq.io",
webAuthnHost: "backup.web.portalhq.io"
)
} catch {
print("Error configuring passkey authentication: \(error)")
}
// Complete setup with authentication anchor
if #available(iOS 16, *) {
do {
// Configure passkey settings
try portal.setPasskeyConfiguration(
relyingParty: "portalhq.io",
webAuthnHost: "backup.web.portalhq.io"
)
// Set the authentication anchor (typically your main window)
try portal.setPasskeyAuthenticationAnchor(view.window!)
// Now you can use passkey-based backup/recovery
try await portal.backupWallet(.Passkey) { status in
print("Backup status: \(status)")
}
} catch {
print("Error setting up passkey authentication: \(error)")
}
}