onDeviceActivated
📱 REL-ID SDK Event: onDeviceActivated
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:
- User authentication (password/biometric)
- Device verification (via verify notification or fallback)
- Consent for LDA (optional)
- Device naming via
setDeviceName()
Scenario | Is onDeviceActivated Triggered? | Purpose |
---|---|---|
✅ First-Time Device Activation | ✔️ Yes | Confirms that the first device has been successfully activated |
✅ Additional Device Activation | ✔️ Yes | Confirms 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
Field | Description |
---|---|
errCode | Top-level error indicator (0 = success) |
errorString | Describes success or failure |
StatusMsg | Message from server confirming activation |
StatusCode | 100 indicates success |
eMethId | Method ID for internal SDK tracking |
pxyDetails | Proxy or MTD related info (usually optional) |
💻 How to Handle
Platform | Code Sample / Listener |
---|---|
React Native | rdnaEventRegistery.addListener('onDeviceActivated', callback) |
Flutter | rdnaClient.on(RdnaClient.onDeviceActivated, callback); |
Cordova | document.addEventListener("onDeviceActivated", callback) |
Android | Implement onDeviceActivated() event callback |
iOS | Implement 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.
Updated 3 months ago