below is the code I used to remove the passkey. the log indicate the "Delete result: true, error: nil". and the ASPasskeyCredentialIdentity initialization parameters are exactly the same as those I used at passkey add time (validated through Xcode debugger). yet the passkey can still been seen in the store (shown in quickType Bar as one of the credential option)
let removePasskey = ASPasskeyCredentialIdentity(relyingPartyIdentifier: passkey.rpId,
userName: passkey.username,
credentialID: passkey.keyId,
userHandle: passkey.userHandle,
recordIdentifier: passkey.coreDataId)
let store = ASCredentialIdentityStore.shared
store.getState { state in
if state.isEnabled {
ASCredentialIdentityStore.shared.removeCredentialIdentities([removePasskey]) {
success, error in
print("Delete result: \(success), error: \(error)")
}
}
}