gpt4 book ai didi

ios - 如何在应用程序中保存凭据以允许自动填充功能?

转载 作者:行者123 更新时间:2023-11-29 05:11:12 25 4
gpt4 key购买 nike

我希望我的应用程序保存用户名和密码数据,例如在第一次登录或注册时,因此当用户稍后尝试再次登录时,操作系统将提供自动填写表单的功能。因此,当应用程序提供保存在 Safari 中的凭据时,情况类似,但我也希望我的应用程序在登录发生时保存此凭据。根据苹果文档,我认为这应该是可能的:

https://developer.apple.com/documentation/security/shared_web_credentials/managing_shared_credentials

If the user can create new accounts in your app, you should save the user name and password to the shared web credentials. In this way, the user can easily access the account from Safari, as well as from within your app. You can save the user’s name and password to the shared web credentials using the SecAddSharedWebCredential(::::) function as shown.

但是当我这样做时:

SecAddSharedWebCredential(domain as CFString, username as CFString, password as CFString) { error in
if let error = error {
print(error)
}
}

我打印出以下错误:

Error Domain=NSOSStatusErrorDomain Code=-909“Safari 设置中未启用自动填充”UserInfo={NSDescription=Safari 设置中未启用自动填充}

最佳答案

当您创建应用时,您将通过 Apple 证明您的身份,以证明以下内容:

  1. That your app will be using the Associated Domains capability.
  2. That your Team ID is, in fact, valid.

查看本教程以获取帮助 How To Secure Your App’s Passwords with Safari AutoFill in iOS 8

关于ios - 如何在应用程序中保存凭据以允许自动填充功能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59667082/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com