我正在尝试使用密码自动填充API,如here所示>>
*重要。 HTML由本地主机提供
我正在使用WKWebview,并且在本地Web服务器中提供了本地html文件。我已经部署了Apple-app-site-association文件,并对此进行了测试,以创建具有用户名和密码的本机文本字段视图,并且效果很好。该应用会自动填写正确的凭据。
在html代码中尝试此操作时,用户名键盘甚至没有显示键锁,也没有提出建议。密码字段确实显示了键锁,我手动打开并选择了密码,并在相应的字段中填写了内容。
因此,我的问题是iOS不会自动建议我的登录凭据,这不利于实现此目的。
这是我的HTML摘录
<input id="user-text-field" type="email" autocomplete = "username" tv-auto-focus class="text-single tvFocusItem tvAutoFocus" ng-model="username" required="true" placeholder="{{::('FORMS.DEFAULT.EMAIL' | spTranslate)}}" ng-disabled="!registerEnabled() || askingForPassword && username"/> <input id="password-text-field" type="password" autocomplete = "current-password" tv-auto-focus class="text-single tvFocusItem tvAutoFocus" pattern=".{1,}" required ng-model="$parent.password" required="true" placeholder="{{::('FORMS.DEFAULT.PASS' | spTranslate)}}" ng-disabled="!$parent.registerEnabled()"/>
因此,任何帮助将不胜感激。
**已更新。启用所有字段时,用户名显示锁定键。自动填充/建议仍然无效
我正在尝试使用密码自动填充API,如此处所示*重要。本地主机正在提供HTML,我正在使用WKWebview,本地Web服务器中提供了本地html文件。我已经部署了...
AFAIK,Apple不允许我们在WKWebview中使用自动填充,因为该应用程序可能会窃取您的信息。