---
title: "Android SDK: User identity"
description: "Identify customers and attach user information with the Gleap Android SDK. Follow the integration code examples."
url: https://docs.gleap.ai/en/articles/467-android-sdk-user-identity
collection: "Android"
updated: 2026-11-01
language: en
---

# Android SDK: User identity

Identify customers and attach user information with the Gleap Android SDK. Follow the integration code examples.

The Gleap identify call lets you tie a user to their feedback items. It includes a unique User ID and optional meta information such as email & name.

### Identify your users

To effectively manage your contacts, we advise using `Gleap.getInstance().identifyContact()` each time a user signs in or registers. This practice ensures accurate identification of your contacts from the outset. Additionally, for scenarios where contact information needs to be updated during active usage – such as when a user subscribes to a new plan or modifies their existing data – we recommend utilizing `Gleap.getInstance().updateContact()`. This method allows for seamless real-time updates to contact details.

Identify your user by calling the following method.

```javascript
GleapSessionProperties sessionProperties = new GleapSessionProperties();
sessionProperties.setEmail("franzi@gleap.ai");
sessionProperties.setName("Franzi");
sessionProperties.setPhone("+1 (902) 123123");
sessionProperties.setValue(199.95);
sessionProperties.setPlan("Pro plan");
sessionProperties.setCompanyName("ACME inc.");
sessionProperties.setCompanyId("193948");
sessionProperties.setAvatar("https://.../avatar.png");

JSONObject jsonObject = new JSONObject();
jsonObject.put("key1", "data one");
jsonObject.put("key2", "data two");
sessionProperties.setCustomData(jsonObject);

Gleap.getInstance().identifyContact("user_ID", sessionProperties);
```

> **Info:** When transmitting custom data, only primitive numeric and string values are supported for later use in segment filters. Please note that you can send only 35 custom data keys with an identify call.
>
> We currently only allow JSON strings, numbers and boolean values as custom data.

> **Info:** Gleap defaults to guest sessions when feedback items get reported without calling the identify method first. All feedback items of an existing guest session are merged with the user session once you've identified it.

### Enforce identity verification

> **Tip:** To also prove the user's email, pass a [signed identity token](https://gleap-developer-docs.gleap.help/en/articles/709-enforce-identity-verification#signed-identity-token-proves-the-email-too) in place of the user hash. Gleap can then [merge earlier conversations](https://gleap-developer-docs.gleap.help/en/articles/709-enforce-identity-verification#merge-contacts) with that email into the user.

Enforce identity verification to prevent third parties from impersonating logged-in users. [Learn how to generate the user hash](https://gleap-developer-docs.gleap.help/en/articles/709-enforce-identity-verification)

```javascript
GleapSessionProperties sessionProperties = new GleapSessionProperties();
sessionProperties.setEmail("franzi@gleap.ai");
sessionProperties.setName("Franzi");
sessionProperties.setPhone("+1 (902) 123123");
sessionProperties.setPlan("Pro plan");
sessionProperties.setCompanyName("ACME inc.");
sessionProperties.setCompanyId("193948");
sessionProperties.setAvatar("https://.../avatar.png");
sessionProperties.setValue(199.95);

// Sets the matching user hash.
sessionProperties.setHash(call.argument("userHash"));

Gleap.getInstance().identifyContact("user_ID", sessionProperties);
```

### Protected conversation files

With **Require authenticated file access** ([Authenticated conversation files](https://gleap-developer-docs.gleap.help/en/articles/710-authenticated-conversation-files)), conversation files can only be opened by agents and by the verified customer the conversation belongs to. The SDK (19.0.0 or newer) supports it without extra setup, as long as your app identifies the customer with the user hash (see above) **on every app start**.

A verified identify gets a short-lived file session (15 minutes). The SDK keeps it in memory only (never on disk), passes it to the widget and renews it automatically before it expires. `clearIdentity` revokes it.

Email replies link attachments to your customer application URL with a `gleapFile` query parameter. If your app handles that URL (for example as an App Link), pass the URL that opened the app to Gleap; once the user is identified, the SDK opens the file's conversation if the user may see it:

```java
Uri link = getIntent().getData();
if (link != null) {
    Gleap.getInstance().openProtectedFileFromUrl(link.toString());
}
```

`openProtectedFileFromUrl` takes the URL as a `String` and returns `false` when it has no valid `gleapFile` parameter. Keep the parameter through your app's login flow.

### Update contact properties

To effectively manage your contacts, we advise using `Gleap.getInstance().identifyContact()` each time a user signs in or registers. This practice ensures accurate identification of your contacts from the outset. Additionally, for scenarios where contact information needs to be updated during active usage – such as when a user subscribes to a new plan or modifies their existing data – we recommend utilizing `Gleap.getInstance().updateContact()`. This method allows for seamless real-time updates to contact details.

```javascript
GleapSessionProperties sessionProperties = new GleapSessionProperties();
sessionProperties.setPlan("Pro plan");
sessionProperties.setValue(199.95);

Gleap.getInstance().updateContact(sessionProperties);
```

The updateContact method takes in the same contact parameters as the identify method. Partial updates are possible.

```javascript
GleapSessionProperties sessionProperties = new GleapSessionProperties();
sessionProperties.setEmail("franzi@gleap.ai");
sessionProperties.setName("Franzi");
sessionProperties.setPhone("+1 (902) 123123");
sessionProperties.setPlan("Pro plan");
sessionProperties.setCompanyName("ACME inc.");
sessionProperties.setCompanyId("193948");
sessionProperties.setAvatar("https://.../avatar.png");
sessionProperties.setValue(199.95);

Gleap.getInstance().updateContact(sessionProperties);
```

### Clear the identity on logout

We recommend to clear the identity once the user logs out. Clearing the identity will automatically detach the current session and create a new guest session.

```js
Gleap.getInstance().clearIdentity();
```

### Get the identification status of a user

With the following method, you can get the status of the current user identity.

```js
Gleap.getInstance().isUserIdentified();
```

### Get the current user identity

With the following method, you can get the current user identity.

```js
Gleap.getInstance().getIdentity();
```

## Related

- [Android SDK setup](https://docs.gleap.ai/en/articles/466-android-sdk-setup.md)
- [Android SDK: Callbacks](https://docs.gleap.ai/en/articles/468-android-sdk-callbacks.md)
- [Android SDK: Frontend tools](https://docs.gleap.ai/en/articles/469-android-sdk-frontend-tools.md)
- [Android SDK: Forms](https://docs.gleap.ai/en/articles/470-android-sdk-forms.md)
- [Android SDK: Feedback button](https://docs.gleap.ai/en/articles/471-android-sdk-feedback-button.md)
