UNPKG

mark-test-sdk-react-native

Version:
60 lines (49 loc) 2.06 kB
'use strict'; import { Platform, NativeModules } from 'react-native'; const VFYSDKNative = Platform.select({ ios: NativeModules.BlinkIDIos, android: NativeModules.BlinkIDAndroid }) class VFYSDKWrapper { async scanWithIdentity(customSettings, license) { try { var licenseObject = license; if (typeof license === 'string' || license instanceof String) { licenseObject = { licenseKey: license }; } const nativeResults = await VFYSDKNative.scanWithIdentity(customSettings, licenseObject); return nativeResults; } catch (error) { console.log("ERROR :: " + error); return []; } } async scanWithCard(customSettings, license) { try { var licenseObject = license; if (typeof license === 'string' || license instanceof String) { licenseObject = { licenseKey: license }; } const nativeResults = await VFYSDKNative.scanWithCard(customSettings, licenseObject); return nativeResults; } catch (error) { console.log(error); return []; } } async scanWithIdSelfieCombine(customSettings, license) { try { var licenseObject = license; if (typeof license === 'string' || license instanceof String) { licenseObject = { licenseKey: license }; } const nativeResults = await VFYSDKNative.scanWithIdSelfieCombine(customSettings, licenseObject); return nativeResults; } catch (error) { console.log(error); return []; } } } export var VFYSDK = new VFYSDKWrapper(); export * from './customSettings'