Flutter iOS 自动填充强密码错误

GIL*_*ILO 4 autofill ios dart flutter

我收到此错误:

[自动填充] 无法显示应用程序包 ID:com.my.app 的自动强密码,因为错误:无法保存此应用程序的密码。确保您已为应用程序设置关联域并在“设置”中启用自动填充密码

我已启用关联域和自动填充凭据提供程序

在此输入图像描述

关联的域也在 appstore connect 上启用。

在我的物理设备上启用了自动填充

在此输入图像描述

这是我的代码

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

我希望这样的事情发生:

在此输入图像描述

GIL*_*ILO 5

好吧,这花了我一段时间才解决。我使用 firebase 来做到这一点。

  1. 使用 Firebase 托管
  2. 在您的计算机上执行firebase init并设置托管
  3. 在公用文件夹中创建一个名为的文件夹.well-known
  4. 在名为 apple-app-site-association 的文件夹中添加一个文件 将其设置为您的文件

苹果应用程序站点关联:

{
  "applinks": {
     "apps": [],
     "details": [
          {
       "appID": "teamID.com.your.app",
       "paths": ["*"]
          }
      ]
  },
  "webcredentials": {
     "apps": ["teamID.com.your.app"]
  }
}
Run Code Online (Sandbox Code Playgroud)

在你的 firebase.json 文件中添加这个

"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 Code Online (Sandbox Code Playgroud)

跑步firebase deploy --only hosting

您可以在https://branch.io/resources/aasa-validator/检查您的 AASA 是否正确

如果可以,请转到 Xcode,在签名和功能中添加关联的域:

applinks:yourfirebasewebsite.com
webcredentials:yourfirebasewebsite.com
Run Code Online (Sandbox Code Playgroud)

确保从手机上删除您的应用程序

移动到你的flutter项目目录运行:

flutter clean; flutter run --release
Run Code Online (Sandbox Code Playgroud)