This event is emitted by the REL-ID SDK to indicate that the SDK has been successfully initialized. It is typically the first confirmation the app receives after calling the initialize() API.
The onInitialized event provides information through its payload that your application needs to process. The structure may vary by platform but typically includes the following data:
This event is critical for accessing session-related data before any secured API call or workflow can begin.
📱 Platform-specific Integration
React Native
// Import the necessary modules
import RdnaClient from 'react-native-rdna-client';
// This is an event handler, not a method to call directly
// Set up event listener for onInitialized event
let onInitializedSubscription = rdnaEventRegistery.addListener(
'onInitialized', (response) => {
// Handle the response
console.log("onInitialized event received:", response);
// Implement your logic here
}
);
// Don't forget to remove the event listener when component unmounts
componentWillUnmount() {
onInitializedSubscription.remove();
}
Flutter
import 'package:flutter/material.dart';
import 'package:rdna_plugin/rdna_plugin.dart';
// This is an event handler, not a method to call directly
// Set up event listener for onInitialized event
rdnaClient.on(RdnaClient.onInitialized, onInitialized);
// Define the callback function
void onInitialized(RDNAInitialized response) {
// Handle the response
print("onInitialized event received");
// Implement your logic here
}
Cordova
// This is an event handler, not a method to call directly
// Set up event listener for onInitialized event
document.addEventListener('onInitialized', onInitialized);
// Define the callback function
function onInitialized(response) {
// Handle the response
console.log("onInitialized event received:", response);
// Implement your logic here
}
Native iOS
// Objective-C
// This is an event handler, not a method to call directly
// Implement the event handler method
- (void)onInitialized:(RDNAChallengeResponse *)response {
// Handle the response
NSLog(@"onInitialized event received");
// Implement your logic here
}
// Swift
// This is an event handler, not a method to call directly
// Implement the event handler method
func onInitialized(_ response: RDNAChallengeResponse) {
// Handle the response
print("onInitialized event received")
// Implement your logic here
}
Native Android
// This is an event handler, not a method to call directly
// Implement the event handler method
@Override
public void onInitialized(RDNA.RDNAChallengeResponse response, RDNAError error) {
// Handle the response
Log.d("REL-ID", "onInitialized event received");
// Implement your logic here
}
✅ Next Steps
Use sessionID and settings to initialize app-level session.