[INJIMOB-1874] add ecr1,eck1 and ed key support (#1594)

* [INJIMOB-1874] add ecr1,eck1 and ed key support

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>

* [INJIMOB-1874] refactor changes

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>

[INJIMOB-1874] refactor changes

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>

---------

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
This commit is contained in:
abhip2565
2024-09-10 14:18:52 +05:30
committed by GitHub
parent c74e802468
commit 47a97c1783
40 changed files with 1588 additions and 896 deletions

View File

@@ -5,7 +5,6 @@ import {
COMMON_PROPS_KEY,
} from './constants';
import {INITIAL_CONFIG} from './InitialConfig';
import Keychain from 'react-native-keychain';
import {getItem, setItem} from '../machines/store';
import {faceMatchConfig} from './commonUtil';
import {configure} from '@iriscan/biometric-sdk-react-native';
@@ -193,19 +192,18 @@ async function generateCacheAPIFunctionWithCachePreference(
fetchCall: (...props: any[]) => any,
onErrorHardCodedValue?: any,
) {
const existingCredentials = await Keychain.getGenericPassword();
try {
const response = await getItem(
cacheKey,
null,
existingCredentials?.password,
""
);
if (response) {
return response;
} else {
const response = await fetchCall();
setItem(cacheKey, response, existingCredentials?.password).then(() =>
setItem(cacheKey, response, "").then(() =>
console.log('Cached response for ' + cacheKey),
);
@@ -231,10 +229,10 @@ async function generateCacheAPIFunctionWithAPIPreference(
fetchCall: (...props: any[]) => any,
onErrorHardCodedValue?: any,
) {
const existingCredentials = await Keychain.getGenericPassword();
try {
const response = await fetchCall();
setItem(cacheKey, response, existingCredentials.password).then(() =>
setItem(cacheKey, response, "").then(() =>
console.log('Cached response for ' + cacheKey),
);
return response;
@@ -249,7 +247,7 @@ async function generateCacheAPIFunctionWithAPIPreference(
const response = await getItem(
cacheKey,
null,
existingCredentials.password,
""
);
if (response) {