fun clearCachedCredentials()

Clears the current connection token, saved reader sessions, and any other cached credentials. You can use this method to switch accounts in your app, e.g. to switch between live and test Stripe API keys on your backend.

In order to switch accounts in your app:

An overview of the lifecycle of a connection token under the hood:

  • When a Terminal is initialized, the SDK attempts to proactively request a connection token from your backend server.

  • When connectBluetoothReader is called, the SDK uses the connection token and reader information to create a reader session.

  • Subsequent calls to connectBluetoothReader require a new connection token. If you disconnect from a reader, and then call connectBluetoothReader again, the SDK will fetch another connection token.