Set and clear user ids

The Inloco SDK automatically generates and synchronizes unique device IDs with the Inloco backend. However, your application and backend systems might use your own User IDs. Passing your User ID to the Inloco SDK allows for easier integration and control, as your User ID will be readily available as an alias.

🚧 Attention: An identifier is a piece of information that is associated with a unique user. While data such as e-mail and phone number are examples of identifiers, their use in the Inloco SDK is forbidden. Consider using non-personal information, such as UUIDs, when setting a User ID.

Setting User IDs

The Inloco SDK provides a User ID setter for passing this information when it is available in your app. This setting is persisted between sessions.

Kotlin
Java
Kotlin
// Setting an User Id
InLoco.setUserId(context, "YOUR_USER_ID")
Java
// Setting an User Id
InLoco.setUserId(context, "YOUR_USER_ID");

Clearing User IDs

You can also clear a previous set User ID using the following method:

Kotlin
Java
Kotlin
// Clearing an User Id
InLoco.clearUserId(context)
Java
// Clearing an User Id
InLoco.clearUserId(context);

🧙Tips: If your app has authentication, it is recommended that the User ID is passed during login, and cleared during logout.

You are ready!

Congratulations! All of your initial configurations have been successfully made and you can now check out our use cases and get started.