Created
December 24, 2023 15:02
-
-
Save jerrywonderr/49eeac7f74572e3008e50ad13c01dc1c to your computer and use it in GitHub Desktop.
Qoreid Implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable react-native/no-inline-styles */ | |
import React, { FC } from "react" | |
import { WebView } from "react-native-webview" | |
import { View } from "native-base" | |
export const KYC: FC<any> = ({ navigation }) => { | |
const remoteScriptUrl = "https://dashboard.qoreid.com/qoreid-sdk/qoreid.js" | |
// Use the injectedJavaScriptBeforeContentLoaded to load the script | |
const remoteScriptInjector = ` | |
const script = document.createElement('script'); | |
script.src = '${remoteScriptUrl}'; | |
document.head.appendChild(script); | |
` | |
return ( | |
<View flex={1} height="full"> | |
<WebView | |
style={{ flex: 1 }} | |
injectedJavaScript={`<qoreid-button | |
id="QoreIDButton" | |
clientId="// YOUR_QOREID_CLIENT_ID" | |
flowId="// YOUR_QOREID_FLOW_ID" | |
productCode="// PRODUCT_CODE" | |
customerReference="// CUSTOMER_REFERENCE" | |
applicantData="// {APPLICANT_DATA_OBJECT}" | |
identityData="// {IDENITY_DATA_OBJECT}" | |
addressData="// {ADDRESS_DATA_OBJECT}" | |
ocrAcceptedDocuments="// OCR_ACCEPTED_DOCUMENT" | |
onQoreIDSdkSubmitted="// ON_SUBMIT_CALLBACK" | |
onQoreIDSdkError="// ON_ERROR_CALLBACK" | |
onQoreIDSdkClosed="// ON_CLOSE_CALLBACK" | |
/>`} | |
injectedJavaScriptBeforeContentLoaded={remoteScriptInjector} | |
/> | |
</View> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment