'Why does iOS Password Autofill not prompt to save password on keychain?

I am setting up iOS Autofill Password in my app, and I followed all the guidelines in this tutorial https://medium.com/developerinsider/ios12-password-autofill-automatic-strong-password-and-security-code-autofill-6e7db8da1810. If I have a manually saved password in the keychain for the app's website, it gives me the option to autofill it on login. However, when the credentials are not saved, the app does not prompt me to save them on login.

My username and password textfields are with correct content types (just like in your tutorial), I have the apple-app-site-association file configured properly, and the associated domains as well.

I don't understand what I am missing.



Solution 1:[1]

You doesn't put any log about that. But the AutoFill feature has some tricks that need attention as describe on Robots & Pencils and other question in stack overflow

One attention point if you update the apple-app-site-association remove the app from your device and install again because the app store the last version as a cache.

Verify the TEAM ID on apps in apple-app-site-association because many get confused with the signing id from your account.

Known issue:

[AutoFill] Cannot show Automatic Strong Passwords for app bundleID: app.bundle.id due to error: iCloud Keychain is disabled

Do you need check on your macOS on Internet Account -> iCloud -> Keychain is enabled and verify in your idevice if the feature is enabled on Settings -> Apple ID -> iCloud -> Keychain is On

In the other case if you followed the tutorial correctly it will be working

Solution 2:[2]

I was having same problem. I did all the setup which recommended by Apple (https://developer.apple.com/documentation/security/password_autofill/about_the_password_autofill_workflow).I had few fields in between UserName and Password field on Signup Screen. But when I put Password field just next to UserName field then Apple popup to save password appearing.

Solution 3:[3]

I have the same problem, Because 3 textField in my viewController, usernameTextField?passwordTextField and authcodeTextField.Set passWordTextField.becomeFirstResponder() before release the controller, its work for me

Solution 4:[4]

I had the same problem. In my case the issue was that I was clearing the username and password text fields after successful authentication before pushing my next view. Apple's heuristics seem to require the text fields with .username and .password content types to be populated when the view disappears.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TheOliverDenis
Solution 2 SamirP
Solution 3
Solution 4 kilovolt42