> For the complete documentation index, see [llms.txt](https://jframework.gitbook.io/help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jframework.gitbook.io/help/services/identity/device/device-identifier.md).

# Device Identifier (Device Code)

## Definition

A **Device Identifier** (device ID) is a unique alphanumeric string assigned to a device by the manufacturer. This identifier serves as a way to uniquely identify a specific piece of hardware. Examples include the IMEI for mobile phones, the MAC address for network interfaces, and serial numbers for various devices. Device Identifiers are critical in various applications including device authentication, tracking, and inventory management.

{% hint style="warning" %}
To prevent confusion with the ID (identity) column in the database table (SQL Server), refer to "Device Identifier" or "Device Code" instead of "Device ID".
{% endhint %}

Adopting a uniform method to assign unique identifiers to devices, such as IMEI or ICCID, optimizes application functionality and security. This approach:

* Enhances user experience by personalizing interactions.
* Increases security by uniquely identifying each device.
* Improves device management and clarity within databases.

End-devs have the flexibility to select the most fitting identifier, ensuring their application meets user needs and adheres to security standards. This strategic implementation of "Device Identifiers" allows for precise tracking and management of each device interaction within an application, streamlining operational efficiency and user satisfaction.

{% tabs %}
{% tab title="iOS" %}
For the best experience and compatibility on iOS devices, it is advisable to use one of the following identifiers:

* **IMEI** (International Mobile Equipment Identity)
* **ICCID** (Integrated Circuit Card Identifier)
* **MEID** (Mobile Equipment Identifier)

#### **Finding Device Identifier on iOS**

To locate your device's IMEI, ICCID, or MEID, follow these simple steps:

1. Open **Settings** and tap on **General**.
2. Select **About**.
3. Scroll until you find the **Serial Number**, **IMEI/MEID**, or **ICCID**.

<figure><img src="/files/K7xSmXH1Ib82bZFRkN14" alt="" width="350"><figcaption><p>An "About" screen on an iOS device.</p></figcaption></figure>

Example IMEI: 357265095594931
{% endtab %}

{% tab title="Android" %}
For the best experience and compatibility on Android devices, it is advisable to use one of the identifiers:

* **IMEI:** This unique identifier for GSM, WCDMA, and iDEN mobile phones can be used for a more hardware-focused identification method. However, due to privacy and security concerns, access to IMEI has been restricted in recent Android versions.
* **Android ID:** A unique 64-bit number generated on the device's first boot. This ID remains constant for the lifetime of the device's factory settings but may change when the device is factory reset.
* **Serial Number:** Provides a hardware-based identifier for the device. The accessibility of the serial number varies by device and Android version.

For further information: <https://developer.android.com/training/articles/user-data-ids>

#### Finding Device Identifier on Android

To locate your device's IMEI, ICCID, or MEID, follow these simple steps:

1. **Open the Settings app** and scroll down to, then tap on **About Phone** or **About Device** depending on your device. Some devices may have this under **System** > **About phone**.
2. Tap on **Status** or **Status Information**.
3. Here, you can find your device's **IMEI number**, **ICCID**, and **MEID**. You may need to tap on **IMEI information** or a similar option, depending on your device model.

Example IMEI: 490154203237518

{% hint style="warning" %}
Starting in Android 10, apps must have the READ\_PRIVILEGED\_PHONE\_STATE privileged permission to access the device's non-resettable identifiers, which include both IMEI and serial numbers.\
\&#xNAN;***Caution: Third-party apps installed from the Google Play Store cannot declare privileged permissions.***\
\&#xNAN;***It's better to not use IMEI/MEID to track Android devices if you want to support Android 10+.***
{% endhint %}
{% endtab %}

{% tab title="Browser" %}
Several pieces of information can be combined to create a unique identifier for a browser. These include:

* **User-Agent String:** This provides detailed information about the browser version, operating system, and device.
* **IP Address:** Though not strictly browser-specific, an IP address can be part of a unique identifier, especially when combined with other data.
* **Browser Fingerprinting:** This technique collects data points like screen resolution, time zone, installed plugins, and fonts. When combined, these can create a highly unique profile of a browser.
* **Cookies and Local Storage:** Websites can generate a unique ID and store it on the user's device using cookies or local storage, ensuring the identifier is sent with each request to the site.
* **Canvas Fingerprinting:** By asking the browser to draw a hidden graphic, websites can exploit small differences in the way each device renders the image, contributing to a unique fingerprint.

Example: For a user accessing our app with the Microsoft Edge browser version 112 on Windows 11, the generated Device Identifier would be:

7a4e8bb8c512686b434f66624e78992df354e25e88e4d21e2383848cbbdcd11b (we use [**creepjs**](https://github.com/abrahamjuliot/creepjs) to generate this string)

This identifier offers us a way to track and optimize our application performance across various devices and browsers efficiently.
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jframework.gitbook.io/help/services/identity/device/device-identifier.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
