Save password in preferences under “Accounts & Passwords”

半世苍凉 提交于 2019-12-10 18:19:35

问题


At WWDC Apple presented the AutoFill feature for iOS Apps in a presentation. It is fairly simple to set up and works really well. If the user entered a password in safari and saved it. However, if the user never used Safari, but only the app, currently the user still has to type out the password every time.

I am already storing the password in the keychain. Unfortunately this does not put the password in the settings below "Accounts & Passwords > App & Website Passwords". Is there any way, how I can store the password the user entered into my app to this settings page, so that the user gets a suggestion for it, when logging in the next time?


回答1:


You can add a Safari Credential in your app and it will show up in Accounts & Passwords > App & Website Passwords. This username/password will then be an autofill option.

See the docs on SecAddSharedWebCredential.



来源:https://stackoverflow.com/questions/45965589/save-password-in-preferences-under-accounts-passwords

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!