“provideCredentialWithoutUserInteractionForIdentity:” is not working

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.

Replies

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"

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".

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"