Flutter TextInput.finishAutofillContext() 在 iOS 中不起作用

问题描述 投票:0回答:1

我想在我的 flutter 应用程序上使用登录页面的自动填充功能。我在表单上使用 AutofillGroup,在每个 TextFormField 上使用 autofillHints,在登录功能上使用 TextInput.finishAutofillContext()。

它在 Android 上完美运行,我可以保存凭据并稍后将其用作自动填充。但不知何故,当我调用 finishAutofillContext 时,保存用户名/密码提示不会出现在 iOS 上。

这是颤振中自动填充的已知错误吗?

ios flutter autofill
1个回答
0
投票

您需要为 iOS 设置关联域:https://developer.apple.com/documentation/xcode/supporting-linked-domains

医生:

https://api.flutter.dev/flutter/material/TextField/autofillHints.html

设置 iOS 自动填充: 为了提供最佳的用户体验并确保您的应用完全支持 iOS 上的密码自动填充,请按照以下步骤操作:

  • 设置您的 iOS 应用程序的关联域。
  • 某些自动填充提示仅适用于特定的键盘类型。例如,AutofillHints.name 需要 TextInputType.name,而 AutofillHints.email 仅适用于 TextInputType.emailAddress。确保输入字段具有兼容的键盘类型。根据经验,TextInputType.name 与 iOS 上预定义的许多自动填充提示配合得很好。

我调用了 TextInput.finishAutofillContext 但自动填充保存 没有显示提示

iOS:iOS 在保存用户密码时可能不会显示提示或任何其他视觉指示。进入“设置”->“密码”并检查您的新密码是否已保存。如果没有在应用程序中正确设置关联域,则保存密码或自动生成强密码都不起作用。要设置关联域,请按照developer.apple.com/documentation/safariservices/supporting_linked_domains_in_your_app 中的说明进行操作。为了获得最佳结果,平台的自动填充服务需要理解提示字符串。提示字符串的常用值可以在 AutofillHints 中找到,以及它们在不同平台上的可用性。

© www.soinside.com 2019 - 2024. All rights reserved.