Get Device ID

📱 REL-ID SDK API Documentation: getDeviceID

📘 Overview

The getDeviceID API provides a unique identifier for the device on which the SDK is currently running. This device ID is useful for device-level authentication, session tracking, and encryption scope.

🎯 Purpose

Use this API to:

  • Retrieve a consistent and unique identifier for the device.
  • Tie authentication tokens or cryptographic operations to a specific device.
  • Enable device-level tracking, audit logging, or access control.

🔁 API Flow

  1. Ensure the SDK is initialized.
  2. Call getDeviceID().
  3. Use the returned device ID string where needed.

🧾 Response

Returns the device ID as a String value.

🔧 Example Response:

{
  "response": "2JUW5N1Z92XK3CSJY3QWB26IY2W5AV529DICH6C12SD7W245U2",
  "error": {
    "shortErrorCode": 0,
    "longErrorCode": 0,
    "errorString": "Success"
  }
}

💻 Code Snippets

React Native
RdnaClient.getDeviceID((response) => {
  const deviceId = response.response;
});
Flutter
final deviceId = await rdnaClient.getDeviceID();
Cordova
com.uniken.rdnaplugin.RdnaClient.getDeviceID(successCallback, errorCallback);
Native iOS
NSString* deviceId = [rdnaClient getDeviceID];
Native Android
String deviceId = rdnaClient.getDeviceID();

⚠️ Error Codes

CodeErrorAction
0SuccessUse the returned value
4RDNA_ERR_INVALID_ARGSEnsure SDK is initialized
88RDNA_ERR_RDNA_ALREADY_INITIALIZEDTypically safe, may ignore

🧠 Developer Notes

  • The device ID is tied to the device and should remain consistent unless the app or device is reset.
  • For cryptographic operations, pair with privacyScope = DEVICE.
  • Should not be confused with session ID or user ID.

📄 End of Documentation