Update IDV Configurations
API: setIDVConfig
📌 Overview
The setIDVConfig
API updates the current IDV configuration. These settings control SDK behavior related to document scanning, selfie capture, and logging.
⚙️ Use Cases
- Enable/disable document authenticity or hologram checks
- Change default database behavior (local vs. server-fetched)
- Adjust debugging or logging options for diagnostics
🧑💻 Method Signature
Platform | Signature |
---|---|
React Native | RdnaClient.setIDVConfig(configJson, callback) |
Flutter | rdna.setIDVConfig(configJson) |
Cordova | com.uniken.rdnaplugin.RdnaClient.setIDVConfig(successCallback, errorCallback, [configJson]) |
Native Android | RDNAError setIDVConfig(String configJson) |
Native iOS | - (RDNAError *)setIDVConfig:(NSString *)configJson; |
📥 Parameters
The input configJson
must include all keys returned from getIDVConfig
.
Example:
{
"selectedDatabaseId": "India",
"nfcScanEnabled": true,
"hologramCheckEnabled": true,
"saveDebugLogs": false,
"saveCroppedImages": true
}
📤 Response
A standard RDNAError
response indicating success or failure.
📄 Code Snippets
React Native
const config = {
selectedDatabaseId: "India",
nfcScanEnabled: true,
hologramCheckEnabled: true,
saveDebugLogs: false,
saveCroppedImages: true
};
RdnaClient.setIDVConfig(config, (result) => {
if (result.shortErrorCode === 0) {
console.log("Config updated successfully");
} else {
console.error("Error:", result.errorString);
}
});
Flutter
final config = {
"selectedDatabaseId": "India",
"nfcScanEnabled": true,
"hologramCheckEnabled": true,
"saveDebugLogs": false,
"saveCroppedImages": true
};
rdna.setIDVConfig(config).then((result) {
if (result["shortErrorCode"] == 0) {
print("Configuration updated.");
} else {
print("Failed: ${result["errorString"]}");
}
});
Cordova
const config = {
selectedDatabaseId: "India",
nfcScanEnabled: true,
hologramCheckEnabled: true,
saveDebugLogs: false,
saveCroppedImages: true
};
com.uniken.rdnaplugin.RdnaClient.setIDVConfig(
function(result) {
console.log("Success:", result);
},
function(err) {
console.error("Error:", err);
},
[config]
);
Native Android
JSONObject config = new JSONObject();
config.put("selectedDatabaseId", "India");
config.put("nfcScanEnabled", true);
config.put("hologramCheckEnabled", true);
config.put("saveDebugLogs", false);
config.put("saveCroppedImages", true);
RDNA.RDNAError result = rdnaClient.setIDVConfig(config.toString());
if (result.getShortErrorCode() == 0) {
Log.d("Config", "Updated successfully");
} else {
Log.e("Config", result.getErrorString());
}
Native iOS (Objective-C)
NSDictionary *config = @{
@"selectedDatabaseId": @"India",
@"nfcScanEnabled": @YES,
@"hologramCheckEnabled": @YES,
@"saveDebugLogs": @NO,
@"saveCroppedImages": @YES
};
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:config options:0 error:nil];
NSString *configJson = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
RDNAError *result = [self.rdnaClient setIDVConfig:configJson];
if (result.shortErrorCode == 0) {
NSLog(@"Configuration updated.");
} else {
NSLog(@"Error: %@", result.errorString);
}
Updated 3 months ago