问题
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