Saturday, 29 September 2018

AutoFill username and password in iOS 12

I implemented AutoFill for stored username and password suggestion successfully in iOS 11.
I have two text fields in my login view controller, one for email, one for password. The content types are defined as follows:

email / username text field configuration
email / username text field configuration

password text field configuration password text field configuration

This used to work just fine in iOS 11, but after upgrading my development iPad to iOS 12, the app suggests emails for the username field and the following happens when editing the password field:

actual result


In my create account view controller, I have 3 text fields: email, password, repeat password. Their content modes are setup as follows:

  • email → email address
  • password → new password, rule: minlength:8;
  • repeat password → new password, rule: minlength:8;

When editing the email address field, it properly suggests an email address. For the password and repeat password fields, however, it suggests stored passwords, instead of suggesting a new password.


What I tried

  • (illogically) flip the content mode setup, so the login password field is set to new password and the create account password fields are set to password
    • no success; in fact, no change of behavior at all
  • set content mode to none for login and create account fields so AutoFill can try to handle it automatically
    • no success; in fact, no change of behavior at all

Note

  • AutoFill is properly setup on the server. The stored passwords being suggested in the create account fields prove that
  • The functionality is still working on iOS 11 iPads
  • When logging in with a new username, the app will ask the user to add this username and password to Keychain, even on iOS 12

Any idea what I need to change so that stored username & password suggestion works in iOS 12 again?

Thanks!



Edit

As requested by @kralex below, here's my view hierarchy for the login view controller in the storyboard:

view hierarchy in storyboard

...and on the device:

view hierarchy on device



from AutoFill username and password in iOS 12

No comments:

Post a Comment