onDeviceActivated

📱 REL-ID SDK Event: onDeviceActivated

🧭 Overview

The onDeviceActivated event is emitted by the REL-ID SDK once the device activation process is successfully completed. It signals that the device is now fully registered, trusted, and ready to participate in REL-ID workflows.


🎯 Purpose

  • Notifies the application that device activation is complete.
  • Enables transition to secure areas of the app (e.g., dashboard).
  • Confirms backend has registered and acknowledged the device.

🔄 When is it Triggered?

This event is triggered after these steps have been successfully completed:

  1. User authentication (password/biometric)
  2. Device verification (via verify notification or fallback)
  3. Consent for LDA (optional)
  4. Device naming via setDeviceName()

ScenarioIs onDeviceActivated Triggered?Purpose
First-Time Device Activation✔️ YesConfirms that the first device has been successfully activated
Additional Device Activation✔️ YesConfirms that a new device (not the first) is now registered and trusted

📥 Sample Event Response

{
  "errCode": 0,
  "error": {
    "longErrorCode": 0,
    "shortErrorCode": 0,
    "errorString": "Success"
  },
  "eMethId": 18,
  "pArgs": {
    "jwt": "",
    "service_details": {},
    "response": {
      "StatusMsg": "Device activated successfully.",
      "StatusCode": 100,
      "CredOpMode": -1
    },
    "pxyDetails": {
      "isStarted": 0,
      "isLocalhostOnly": 0,
      "isAutoStarted": 0,
      "isPrivacyEnabled": 0,
      "portType": 0,
      "port": 0
    }
  }
}

🔧 Response Fields Explained

FieldDescription
errCodeTop-level error indicator (0 = success)
errorStringDescribes success or failure
StatusMsgMessage from server confirming activation
StatusCode100 indicates success
eMethIdMethod ID for internal SDK tracking
pxyDetailsProxy or MTD related info (usually optional)

💻 How to Handle

PlatformCode Sample / Listener
React NativerdnaEventRegistery.addListener('onDeviceActivated', callback)
FlutterrdnaClient.on(RdnaClient.onDeviceActivated, callback);
Cordovadocument.addEventListener("onDeviceActivated", callback)
AndroidImplement onDeviceActivated() event callback
iOSImplement delegate onDeviceActivated() method

✅ On Success

  • Navigate user to main dashboard or post-login experience.
  • Show toast/snackbar like “Device successfully activated.”

❌ On Failure

  • (Unlikely here — failures usually occur before this stage.)
  • If error fields indicate failure, show message and contact support.

Summary

onDeviceActivated = "this device is now trusted and linked to the user's REL-ID identity", whether it’s the first, second, or any subsequent device.