Setting Device Name

🧭 Overview - getDeviceName Event

The REL-ID SDK triggers the getDeviceName event during during user activation or device registration when a new device is being activated or registered. It expects the mobile app to respond by prompting the user for a friendly device name and then call the setDeviceName API with the chosen name.

This process helps identify and manage multiple devices linked to the same user account in the REL-ID platform.


🎯 Purpose

  • 🔐 To associate a user-friendly name with the current device
  • 📱 To help users identify their devices during multi-device scenarios
  • 🛠️ Typically used in the first-time login or new device activation flow

📱 UI Guidance

Present a screen asking the user to enter or confirm a device name. REL-ID SDK provides an autoGeneratedDeviceName which can be displayed as a suggestion.

Recommended UI elements:

  • Editable text input field pre-filled with autoGeneratedDeviceName
  • Confirm button
  • Optional: Info icon or help message about why device name is needed

📥 Sample Payload

{
  "userID": "testuser",
  "autoGeneratedDeviceName": "Android_MiA2_112919193803",
  "challengeResponse": {
    "status": {
      "statusCode": 100,
      "statusMessage": ""
    },
    "session": {
      "sessionType": 0,
      "sessionID": "<SESSION_ID>"
    },
    "additionalInfo": {
      "DNAProxyPort": 0,
      "isAdUser": 0,
      "isDNAProxyLocalHostOnly": 0,
      "JWT": ""
    },
    "challengeInfo": []
  },
  "error": {
    "longErrorCode": 0,
    "shortErrorCode": 0,
    "errorString": "Success"
  }
}

🔑 Relevant Fields

FieldDescription
userIDUsername associated with the login
autoGeneratedDeviceNameSuggested device name generated by SDK
session.sessionIDUnique session ID
error.shortErrorCodeIndicates if there's any error

📲 API: setDeviceName

This API is used to respond to the getDeviceName event with the chosen device name. Once the user enters the device name, call the setDeviceName API to send it back to the SDK

📥 Input

ParameterTypeRequiredDescription
deviceNameStringDevice name provided by the user

💻 Platform-Specific Usage

React Native
RdnaClient.setDeviceName("Aditya's Pixel 6", (syncResponse) => {
  console.log("Device name set status:", syncResponse);
});
Flutter
rdnaClient.setDeviceName("Aditya's iPad");
Cordova
com.uniken.rdnaplugin.RdnaClient.setDeviceName(
  () => console.log("Device name set"),
  (err) => console.error("Error setting name", err),
  ["Aditya's Device"]
);
Native Android
RDNAError error = rdna.setDeviceName("Aditya's Galaxy");
Native iOS
[client setDeviceName:@"Aditya's iPhone"];

❗ Error Handling

Common Errors

Short CodeError EnumDescriptionSuggested Action
4RDNA_ERR_INVALID_ARGSInvalid or missing device namePrompt user and retry
17RDNA_ERR_SERVICE_NOT_SUPPORTEDFeature unsupportedSkip or contact support
52RDNA_ERR_FAILED_TO_OPEN_HTTP_CONNECTIONNetwork issuesRetry
116RDNA_ERR_CIS_CONFIGURATION_INVALIDServer misconfigurationContact admin
131RDNA_ERR_STEPUP_AUTH_LDA_BIOMETRIC_CANCELLED_BY_USERBiometric prompt cancelledAllow retry or fallback

On Success

  • Proceed to the next authentication step such as addAlternateLoginId
  • Store/display device name locally if needed

On Failure

  • Retry or fallback to suggested autoGeneratedDeviceName
  • Provide error message to user

_