How does password saving work on iOS for Flutter apps


To enable password-saving functionality, I’ve configured associated domains in the info.plist.

<key>com.apple.developer.associated-domains</key>
<array>
<string>webcredentials:https://mydomain/.well-known/apple-app-site-association.json</string>
<string>applinks:https://mydomain/.well-known/apple-app-site-association.json</string>
</array>
<key>com.apple.developer.authentication-services.autofill credential-provider</key>

Despite these configurations, the expected password save dialog doesn’t appear when using the app on iOS. I’ve verified the accessibility and functionality of the HTTPS endpoint and it is hosted and when I open the link I can see the content of json inside it. Also I enable keychain sharing(com.package.appname) and autofill credential provider in Xcode and the associated domains but the dialog still didn’t appear to save the password

my code:

  Form(
  key: _formKey,
  child: AutofillGroup(
    child: Column(
      children: [
        TextFormField(
          controller: _usernameController,
          autofillHints: [AutofillHints.username],
          decoration: InputDecoration(
            labelText: 'Username',
          ),
        ),
        TextFormField(
          controller: _passwordController,
          autofillHints: [AutofillHints.password],
          obscureText: true,
          decoration: InputDecoration(
            labelText: 'Password',
          ),
        ),
        ElevatedButton(
          onPressed: () {
            if (_formKey.currentState.validate()) {
              TextInput.finishAutofillContext();
              // Submit form
            }
          },
          child: Text('Submit'),
        ),
      ],
    ),
  ),
);

jsonfile content:

    {
    "applinks": {
        "details": [
             {
               "appIDs": [ "teamID.bundleId" ],
               "components": [
                 {
                    "#": "no_universal_links",
                    "exclude": true,
                    "comment": "Matches any URL with a fragment that equals no_universal_links and instructs the system not to open it as a universal link."
                 },
                 {
                    "/": "/buy/*",
                    "comment": "Matches any URL with a path that starts with /buy/."
                 },
                 {
                    "/": "/help/website/*",
                    "exclude": true,
                    "comment": "Matches any URL with a path that starts with /help/website/ and instructs the system not to open it as a universal link."
                 },
                 {
                    "/": "/help/*",
                    "?": { "articleNumber": "????" },
                    "comment": "Matches any URL with a path that starts with /help/ and that has a query item with name 'articleNumber' and a value of exactly four characters."
                 }
               ]
             }
         ]
     },
     "webcredentials": {
        "apps": [ "teamID.bundleId" ]
     },
  
  
      "appclips": {
          "apps": ["teamID.bundleId"]
      }
  }

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img