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
- Ensure the SDK is initialized.
- Call
getDeviceID()
. - 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
Code | Error | Action |
---|---|---|
0 | Success | Use the returned value |
4 | RDNA_ERR_INVALID_ARGS | Ensure SDK is initialized |
88 | RDNA_ERR_RDNA_ALREADY_INITIALIZED | Typically 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
Updated 3 months ago