Instance Method

prepareInterfaceToProvideCredentialForIdentity:

Prepares the interface for a user interaction, like a database login, that enables it to access and return the credential for the given identity.

Declaration

- (void)prepareInterfaceToProvideCredentialForIdentity:(ASPasswordCredentialIdentity *)credentialIdentity;

Parameters

credentialIdentity

The credential identity for which a credential should be provided.

Discussion

The system calls this method when your extension can’t provide the requested credential without user interaction. Set up the view controller for any user interaction required to provide the requested credential. Limit user interaction to operations required for providing the requested credential, like showing an authentication UI to unlock the user’s passwords database.

Call the context’s completeRequestWithSelectedCredential:completionHandler: to provide the credential. Alternatively, if an error occurs, call cancelRequestWithError: instead and pass an error with domain ASExtensionErrorDomain and an appropriate error code from ASExtensionErrorCode. For example, if your app can’t find the credential identity in the database, pass an error with code ASExtensionErrorCodeCredentialIdentityNotFound.

See Also

Integrating Your Extension with the QuickType Bar

- provideCredentialWithoutUserInteractionForIdentity:

Attempts to provide the user-requested credential with no further user interaction.

ASPasswordCredentialIdentity

A description that uniquely identifies a particular credential.