3 Replies
      Latest reply on Feb 12, 2019 1:58 AM by eskimo
      vdkdamian Level 1 Level 1 (0 points)

        I have an app that autofills the password on iOS 12. Now I want to implement this function:

        But I cant get it to work like it should.

        AutoFill is enabled in settings and also enabled for my app.

         

        I've read the documentation but this doens't help me. https://developer.apple.com/documentation/authenticationservices/ascredentialproviderviewcontroller/2977554-providecredentialwithoutuserinte?language=objc

         

        I've tried calling this function from viewDidLoad, prepareCredentialListForServiceIdentifiers,.. but this is stupid and definitely won't work.

         

        - (void)provideCredentialWithoutUserInteractionForIdentity:(ASPasswordCredentialIdentity *)credentialIdentity {
             ASPasswordCredential *credential = [[ASPasswordCredential alloc] initWithUser:@"theUsername" password:@"thePassword"];
             [self.extensionContext completeRequestWithSelectedCredential:credential completionHandler:nil];
        }

        The function should show the credentials above the keyboard, but this doesn't happen. It just shows the default "Passwords" button.

        • Re: “provideCredentialWithoutUserInteractionForIdentity:” is not working
          eskimo Apple Staff Apple Staff (11,625 points)

          I have an app that autofills the password on iOS 12. Now I want to implement [-provideCredentialWithoutUserInteractionForIdentity:].

          I’m confused.  There’s two parts to the AutoFill story:

          • Making your app compatible with AutoFill

          • Making an AutoFill credential provider, that is, an app extension that provide credentials to AutoFill-compatible apps, that is, a ‘password vault’

          Reading the text of your post I’m not sure which of these you’re trying to achieve.  Please clarify.

          ps If you’re looking for more background on these technologies, watch WWDC 2018 Session 204 Automatic Strong Passwords and Security Code AutoFill and WWDC 2018 Session 721 Implementing AutoFill Credential Provider Extensions, respectively.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

            • Re: “provideCredentialWithoutUserInteractionForIdentity:” is not working
              vdkdamian Level 1 Level 1 (0 points)

              My question is about

              • Making an AutoFill credential provider, that is, an app extension that provide credentials to AutoFill-compatible apps, that is, a ‘password vault’

               

              But I got this working. My "vault" like you call it is working fine. Now I just want to implement

              [-provideCredentialWithoutUserInteractionForIdentity:].

               

              But this is where I can't get this function working. This function should show the user's email above the keyboard, so if you click it, it instantly fills in the credentials. So you dont have to enter the "vault".

                • Re: “provideCredentialWithoutUserInteractionForIdentity:” is not working
                  eskimo Apple Staff Apple Staff (11,625 points)

                  My question is about [making] an AutoFill credential provider

                  Cool.

                  So you dont have to enter the "vault".

                  OK.  What ‘client’ app are you using to test this?  Safari?  Some other vendor’s third-party app?  Or something you created yourself?

                  Share and Enjoy

                  Quinn “The Eskimo!”
                  Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                  let myEmail = "eskimo" + "1" + "@apple.com"