Flutter iOS autofill strong password error
Ok this took me a while to work out. I used firebase to do this.
- Use Firebase Hosting
- On your computer do
firebase init
and set up hosting - In the public folder create a folder called
.well-known
- 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
Comments
-
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
Associated domains is also enabled on appstore connect.
On my physical device autofill is enabled
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: