简体   繁体   中英

Show Automatic Strong password iOS in Flutter app

For a small coding project I manually installed my homemade Flutter app on my iPhone. This app has a Registration page, where a user can fill in their email and password to sign up for the app. To enable iOS Automatic Strong Password I used the Flutter AutofillGroup widget, and provided the appropriate AutofillHints to the corresponding textfields:

return AuthScaffoldView(
      title: 'Sign in',
      child: Container(
        color: Colors.white,
        child: AutofillGroup(
          child: Column(
            children: [
              CupertinoTextField(
                onEditingComplete: () => FocusScope.of(context).unfocus(),
                placeholder: 'Email',
                keyboardType: TextInputType.emailAddress,
                controller: model.editableUser.email,
                autofillHints: [AutofillHints.email],
                clearButtonMode: OverlayVisibilityMode.editing,
              ),
              CupertinoTextField(
                onEditingComplete: () => FocusScope.of(context).unfocus(),
                placeholder: 'Wachtwoord',
                controller: model.editableUser.password,
                autofillHints: [AutofillHints.newPassword],
                clearButtonMode: OverlayVisibilityMode.editing,
              ),
              CupertinoTextField(...

When I run the app on my phone, the AutofillHints work as expected for the email TextField, but on tapping the password TextField I get the following error as Xcode output:

[AutoFill] Cannot show Automatic Strong Passwords for app bundleID: {bundleID} due to error: Cannot identify the calling app's process. Check teamID and bundleID in your app's application-identifier entitlement [AutoFill] Cannot show Automatic Strong Passwords for app bundleID: {bundleID} due to error: Cannot identify the calling app's process. Check teamID and bundleID in your app's application-identifier entitlement .

I signed my app in Xcode (under Signing & Capabilities ) with the appropriate Team and Bundle Identifier . Does anybody know where this error is coming from?

Are you trying to indicate to the user, whether a password is strong enough or not? Please use this package here to do this:

https://pub.dev/packages/password_strength

Make sure to replace the password field, with this package's widget

I was able to solve this by meeting the following prerequisites for Autofill Strong Password to work on iOS:

  1. Set up Associated Domains : https://developer.apple.com/documentation/xcode/supporting-associated-domains . It involves serving an apple-app-site-association file from the root (or.well-known) directory of your webserver, and adding the Associated Domains entitlement to your list of app entitlements.
  2. Add the Autofill Credential Provider entitlement to your app.

PS. The latest Flutter 2.8.x contains a bug, which is discussed here https://github.com/flutter/flutter/issues/94043 , so if you want to get it working you need to either downgrade to v.2.5.x or wait for the bug fix.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM