Class

ASCredentialIdentityStore

A container that your extension fills to provide credentials through the QuickType bar.

Declaration

@interface ASCredentialIdentityStore : NSObject

Overview

Make credential identities available to users directly in the QuickType bar by adding them to the sharedStore instance of the identity store. You can add identities during configuration in your extension’s override of the prepareInterfaceForExtensionConfiguration method. You can also update the shared store from within your extension’s host app.

Be sure to update the shared store whenever your app’s database changes to avoid showing stale identities in the QuickType bar. Take advantage of the incremental change methods replaceCredentialIdentitiesWithIdentities:completion: and removeCredentialIdentities:completion: to avoid rewriting the entire store every time you need to make a change.

When the user disables your extension, the system clears and disables your shared store. So before making updates, check to see that the store is enabled to avoid unnecessary activity:

let store = ASCredentialIdentityStore.shared
store.getState { state in
    if state.isEnabled {
        // Add, remove, or update identities.
    }
}

Topics

Getting the Shared Store

sharedStore

The shared credential identity store.

Checking the State of the Store

- getCredentialIdentityStoreStateWithCompletion:

Gets the state of the credential identity store.

ASCredentialIdentityStoreState

A representation of the state of a credential identity store.

Adding and Removing Credential Identities

- saveCredentialIdentities:completion:

Saves the given credential identities to the store.

- replaceCredentialIdentitiesWithIdentities:completion:

Replaces existing credential identities with new credential identities.

- removeAllCredentialIdentitiesWithCompletion:

Removes all existing credential identities from the store.

- removeCredentialIdentities:completion:

Removes the given credential identities from the store.

ASPasswordCredentialIdentity

A description that uniquely identifies a particular credential.

Recognizing Errors

ASCredentialIdentityStoreErrorDomain

The domain for a credential identity store error.

ASCredentialIdentityStoreErrorCode

Constants that represent credential identity store error codes.

Relationships

Inherits From

See Also

Configuring the Credential Provider Extension

- prepareInterfaceForExtensionConfiguration

Prepares the interface to enable the user to configure the extension.