Skip to main content
Version: v6

Account ID

The Account ID uniquely identifies each user account – it is an ID generated by Incognia's customers to represent each unique user of their app. It is a required field for the Login API and Payments API, and it is used together with the Feedback API to track device access to different accounts.

warning
To avoid sharing raw internal account identifiers, we highly recommend hashing the account ID before calling our API.

Setting the Account ID

The Account ID should be set on the SDK to create an association between the device and the user account. This association must happen in two moments:

1. Whenever the application initializes

This covers the scenario where the application is updated with the Incognia SDK and the user is already logged in. The Application.onCreate() on Android and the [AppDelegate application:didFinishLaunchingWithOptions:] on iOS are good places to do this.

If the Account Id is not available in those locations, it is important to forward the value to the Incognia SDK as soon as it is available. The important action here is to call setAccountId whenever the application initializes so it is guaranteed that we always know that a specific user is associated with a specific device.

2. Whenever the user logs in and out

It is necessary to call the setAccountId method when the user finishes the login and clearAccountId when the user logs out. This is usually done in the callback of these two actions.

// Set the Account ID
Incognia.setAccountId(accountId)

To clear the Account ID, call a Incognia.clearAccountId when the user logs out.

// Clear the Account ID
Incognia.clearAccountId()