title: How to get iOS 12 Autofill to ask to save password in React Native app?
body: <h1>PROBLEM</h1>
  
  <p>I'm on <em>React Native 0.59.9</em> (latest at the time of this post), and have a login screen in my mobile app that I would like iOS 12's autofill feature to pick up and save the password for a new user. With what I've set up, the app shows the keyboard with the autofill option but never pop's up the 'Save Password' for a new user's credentials.</p>
  
  <p>What the keyboard autofill looks like right now:
  <a href="https://imgur.com/6gVpGbU" rel="noreferrer">https://imgur.com/6gVpGbU</a></p>
  
  <h1>SOME BACKGROUND INFO</h1>
  
  <p>In React Native's documentation, they now expose textContentType in the TextInput component. To set it up for iOS 11 autofill, the username textContentType would be set to 'username' and the password textContentType would be set to 'password'. </p>
  
  <p>RN textContentType documentation:
  <a href="https://facebook.github.io/react-native/docs/textinput#textcontenttype" rel="noreferrer">https://facebook.github.io/react-native/docs/textinput#textcontenttype</a></p>
  
  <p>For iOS 12 autofill, which is supposed to introduce the 'Save Password' feature to mobile app's as well now (previously was websites only) the configuration is different for the password.</p>
  
  <p>The password textContentType would be set to 'newPassword' instead. This isn't working though, in fact it seems to be buggy and breaks the app as it suggests username's for the password field with this set...</p>
  
  <h1>Implementation</h1>
  
  <p>What I've tried to do to implement iOS 12's autofill feature in React Native:</p>
  
  <pre><code>&lt;TextInput
    placeholder={'Enter username'}
    autoCapitalize={'none'}
    autoCorrect={false}
    textContentType={'username'}
  /&gt;
  &lt;TextInput
    placeholder={'Enter password'}
    autoCapitalize={'none'}
    autoCorrect={false}
    secureTextEntry={true}
    textContentType={'newPassword'}
  /&gt;
  </code></pre>
  
  <p>In the mobile provision, I've made sure to enable Associated Domains as an entitlement. (Done through Apple Developer website).</p>
  
  <p>In my domain (for example www.mydomain.com), the file apple-app-site-association (with no extension) that has the following has been put into the root directory and is publicly available (https supported).</p>
  
  <pre><code>{
      "webcredentials": {
          "apps": [
              “ZT978FY6AB.com.company.my.app”,
          ]
      }
  }
  </code></pre>
  
  <p>In XCode, I've set up the Associated Domains to point to that domain.
  Example:</p>
  
  <pre><code>webcredentials:www.mydomain.com
  </code></pre>
  
  <h1>OUTPUT</h1>
  
  <p>The expected output of implementing this is that iOS pops up the 'Save Password' dialog when a new user enter's their credentials.</p>
  
  <p>What the pop up dialog should look like:
  <a href="https://imgur.com/GH4hfP8" rel="noreferrer">https://imgur.com/GH4hfP8</a></p>
  
  <p>Instead, it never pops up. The user just heads straight into the app upon successful login without the dialog ever appearing for saving the password. This essentially means that none of my users can save their credentials to the password manager of their choice (not even iCloud keychain).</p>
  
  <p>Since this feature does not seem to be testable on a simulator, I've been testing it on an iPhone 7 Plus with iOS 12.3.1 installed and autofill enabled in the settings as can be seen in the below image.</p>
  
  <p><a href="https://imgur.com/nSEmy7V" rel="noreferrer">https://imgur.com/nSEmy7V</a></p>
  
  <p><strong>Any ideas what I'm doing wrong, or if I'm missing a step?</strong></p>