Flutter iOS autofill strong password error

811

Ok this took me a while to work out. I used firebase to do this.

  1. Use Firebase Hosting
  2. On your computer do firebase init and set up hosting
  3. In the public folder create a folder called .well-known
  4. Add a file in the folder called apple-app-site-association Set this as your file

apple-app-site-association:

{
  "applinks": {
     "apps": [],
     "details": [
          {
       "appID": "teamID.com.your.app",
       "paths": ["*"]
          }
      ]
  },
  "webcredentials": {
     "apps": ["teamID.com.your.app"]
  }
}

in your firebase.json file add this

"hosting": {
"public": "public",
"ignore": [
  "firebase.json",
  "**/.*",
  "**/node_modules/**"
],
"headers": [
  {
    "source": "/.well-known/apple-app-site-association",
    "headers": [{"key": "Content-Type", "value": "application/json"}]
  }
],
"appAssociation": "NONE"
}

run firebase deploy --only hosting

You can check your AASA is correct at https://branch.io/resources/aasa-validator/

If it is ok go to Xcode, in signing and capabilities add associated domains:

applinks:yourfirebasewebsite.com
webcredentials:yourfirebasewebsite.com

Make sure you delete your app off your phone

Move to your flutter project directory run:

flutter clean; flutter run --release
Share:
811
GILO
Author by

GILO

cool, super duper cool. Yeahhhhhhh

Updated on December 30, 2022

Comments

  • GILO
    GILO over 1 year

    I get this error:

    [AutoFill] Cannot show Automatic Strong Passwords for app bundleID: com.my.app due to error: Cannot save passwords for this app. Make sure you have set up Associated Domains for your app and AutoFill Passwords is enabled in Settings

    I have enabled associated domains and autofill credential provider

    enter image description here

    Associated domains is also enabled on appstore connect.

    On my physical device autofill is enabled

    enter image description here

    This is my code

    AutofillGroup(
      child: Column(
        children: <Widget>[
          CupertinoTextField(
            controller: email,
            enableSuggestions: true,
            keyboardType: TextInputType.emailAddress,
            autofillHints: [AutofillHints.email],
          ),
          CupertinoTextField(
            controller: newPassword,
            enableSuggestions: true,
            autofillHints: [AutofillHints.newPassword],
          )
        ],
      ),
    )
    

    I would like this to happen:

    enter image description here