initPersistentStore static method

Future<ArcGISCredentialStore> initPersistentStore({
  1. ArcGISCredentialStoreIOSOptions? iosOptions,
})

Creates a credential store with a persistent backing store.

A persistent backing store permits credentials to be reused even after the app is restarted. Credentials are stored securely using a platform-specific mechanism: Keychain on iOS, and KeyStore on Android.

An ArcGISCredentialStore is returned by the Future. Use it to set the AuthenticationManager.arcGISCredentialStore property:

ArcGISEnvironment.authenticationManager.arcGISCredentialStore =
  await ArcGISCredentialStore.initPersistentStore();

Do this before any authentication requests are processed, such as in your main() function.

If credentials already exist in the persistent backing store, such as from a previous session, they will be loaded into the credential store returned by this Future. Subsequent changes to the credential store will be synced to the persistent backing store.

Optionally, provide ArcGISCredentialStoreIOSOptions to configure iOS-specific options for the credential store to indicate whether the persisted credentials are synchronized with iCloud and to control keychain access.