@qore-id/react-native-qoreid-sdk 0.1.0-snapshot

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +127 -0
  3. package/android/Untitled +0 -0
  4. package/android/build.gradle +109 -0
  5. package/android/gradle.properties +9 -0
  6. package/android/src/main/AndroidManifest.xml +4 -0
  7. package/android/src/main/java/com/qoreidsdk/QoreIdJSData.kt +49 -0
  8. package/android/src/main/java/com/qoreidsdk/QoreIdReactButtonFragment.kt +116 -0
  9. package/android/src/main/java/com/qoreidsdk/QoreIdReactButtonManager.kt +168 -0
  10. package/android/src/main/java/com/qoreidsdk/QoreidSdkModule.kt +88 -0
  11. package/android/src/main/java/com/qoreidsdk/QoreidSdkPackage.kt +20 -0
  12. package/android/src/main/java/com/qoreidsdk/StyleOption.kt +7 -0
  13. package/ios/QoreidSdk.h +12 -0
  14. package/ios/QoreidSdk.mm +27 -0
  15. package/ios/QoreidSdk.xcodeproj/project.pbxproj +274 -0
  16. package/ios/QoreidSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
  17. package/lib/commonjs/index.js +25 -0
  18. package/lib/commonjs/index.js.map +1 -0
  19. package/lib/commonjs/qoreIdButton.android.js +97 -0
  20. package/lib/commonjs/qoreIdButton.android.js.map +1 -0
  21. package/lib/commonjs/qoreIdButton.ios.js +129 -0
  22. package/lib/commonjs/qoreIdButton.ios.js.map +1 -0
  23. package/lib/commonjs/react-native-qoreid-sdk.d.js +6 -0
  24. package/lib/commonjs/react-native-qoreid-sdk.d.js.map +1 -0
  25. package/lib/commonjs/types.d.js +6 -0
  26. package/lib/commonjs/types.d.js.map +1 -0
  27. package/lib/commonjs/utils.js +20 -0
  28. package/lib/commonjs/utils.js.map +1 -0
  29. package/lib/module/index.js +4 -0
  30. package/lib/module/index.js.map +1 -0
  31. package/lib/module/qoreIdButton.android.js +88 -0
  32. package/lib/module/qoreIdButton.android.js.map +1 -0
  33. package/lib/module/qoreIdButton.ios.js +121 -0
  34. package/lib/module/qoreIdButton.ios.js.map +1 -0
  35. package/lib/module/react-native-qoreid-sdk.d.js +2 -0
  36. package/lib/module/react-native-qoreid-sdk.d.js.map +1 -0
  37. package/lib/module/types.d.js +2 -0
  38. package/lib/module/types.d.js.map +1 -0
  39. package/lib/module/utils.js +13 -0
  40. package/lib/module/utils.js.map +1 -0
  41. package/lib/typescript/index.d.ts +5 -0
  42. package/lib/typescript/index.d.ts.map +1 -0
  43. package/lib/typescript/qoreIdButton.android.d.ts +4 -0
  44. package/lib/typescript/qoreIdButton.android.d.ts.map +1 -0
  45. package/lib/typescript/qoreIdButton.ios.d.ts +4 -0
  46. package/lib/typescript/qoreIdButton.ios.d.ts.map +1 -0
  47. package/lib/typescript/utils.d.ts +9 -0
  48. package/lib/typescript/utils.d.ts.map +1 -0
  49. package/package.json +165 -0
  50. package/react-native-qoreid-sdk.podspec +35 -0
  51. package/src/index.tsx +10 -0
  52. package/src/qoreIdButton.android.tsx +136 -0
  53. package/src/qoreIdButton.ios.tsx +150 -0
  54. package/src/react-native-qoreid-sdk.d.ts +3 -0
  55. package/src/types.d.ts +99 -0
  56. package/src/utils.ts +73 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.d.ts"],"mappings":""}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.utils = void 0;
7
+ const acceptedDocuments = {
8
+ Nigeria: ['DRIVERS_LICENSE_NGA', 'VOTERS_CARD_NGA', 'NIN_SLIP_NGA', 'PASSPORT_NGA'],
9
+ Ghana: ['DRIVERS_LICENSE_GHA', 'NHIS_CARD_GHA', 'ECOWAS_CARD_GHA', 'SOCIAL_SECURITY_GHA', 'VOTERS_CARD_GHA', 'PASSPORT_GHA', 'GHANA_CARD_GHA'],
10
+ Kenya: ['DRIVERS_LICENSE_KEN', 'NATIONAL_ID_KEN', 'REFUGEE_ID_KEN', 'PASSPORT_KEN']
11
+ };
12
+ const productCodes = ['alien_card', 'brs', 'business_address', 'bvn_basic', 'bvn_boolean', 'bvn_nuban', 'bvn_premium', 'cac_basic', 'cac_premium', 'drivers_license', 'employment', 'guarantor', 'face_verification_bvn', 'face_verification_drivers_license', 'face_verification_nin', 'face_verification_passport_ng', 'face_verification_passport_ke', 'face_verification_vnin', 'individual_address', 'kenya_id', 'license_plate_basic', 'license_plate_premium', 'liveness', 'liveness_bvn', 'liveness_drivers_license', 'liveness_nin', 'liveness_ocr', 'liveness_passport_ng', 'liveness_vnin', 'nin', 'nin_phone', 'nuban', 'ocr', 'passport_ng', 'passport_ke', 'property', 'tin',
13
+ // "vehicle",
14
+ 'verifind', 'verifind_4d', 'vin', 'virtual_nin'];
15
+ const utils = {
16
+ productCodes,
17
+ acceptedDocuments
18
+ };
19
+ exports.utils = utils;
20
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["acceptedDocuments","Nigeria","Ghana","Kenya","productCodes","utils","exports"],"sourceRoot":"../../src","sources":["utils.ts"],"mappings":";;;;;;AAAA,MAAMA,iBAAiB,GAAG;EACxBC,OAAO,EAAE,CACP,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,cAAc,CACf;EACDC,KAAK,EAAE,CACL,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,CACjB;EACDC,KAAK,EAAE,CACL,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc;AAElB,CAAC;AAED,MAAMC,YAAY,GAAG,CACnB,YAAY,EACZ,KAAK,EACL,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,WAAW,EACX,aAAa,EACb,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,uBAAuB,EACvB,mCAAmC,EACnC,uBAAuB,EACvB,+BAA+B,EAC/B,+BAA+B,EAC/B,wBAAwB,EACxB,oBAAoB,EACpB,UAAU,EACV,qBAAqB,EACrB,uBAAuB,EACvB,UAAU,EACV,cAAc,EACd,0BAA0B,EAC1B,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,KAAK,EACL,WAAW,EACX,OAAO,EACP,KAAK,EACL,aAAa,EACb,aAAa,EACb,UAAU,EACV,KAAK;AACL;AACA,UAAU,EACV,aAAa,EACb,KAAK,EACL,aAAa,CACd;AAEM,MAAMC,KAAK,GAAG;EACnBD,YAAY;EACZJ;AACF,CAAC;AAACM,OAAA,CAAAD,KAAA,GAAAA,KAAA"}
@@ -0,0 +1,4 @@
1
+ import { Platform } from 'react-native';
2
+ export const QoreIdButton = Platform.OS === 'android' ? require('./qoreIdButton.android').QoreIdButton : require('./qoreIdButton.ios').QoreIdButton;
3
+ export * from './utils';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Platform","QoreIdButton","OS","require"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAGvC,OAAO,MAAMC,YAAY,GACvBD,QAAQ,CAACE,EAAE,KAAK,SAAS,GACpBC,OAAO,CAAC,wBAAwB,CAAC,CAC/BF,YAAY,GACdE,OAAO,CAAC,oBAAoB,CAAC,CAACF,YAAwC;AAE7E,cAAc,SAAS"}
@@ -0,0 +1,88 @@
1
+ import React, { forwardRef, useCallback, useEffect, useRef } from 'react';
2
+ import { UIManager, findNodeHandle, requireNativeComponent, View, NativeEventEmitter, NativeModules } from 'react-native';
3
+ const QoreIdReactButtonManager = requireNativeComponent('QoreIdReactButtonManager');
4
+ const Button = /*#__PURE__*/forwardRef((_props, ref) => {
5
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
6
+ style: {
7
+ position: 'relative',
8
+ margin: 'auto',
9
+ height: 55,
10
+ borderWidth: 1
11
+ }
12
+ }, /*#__PURE__*/React.createElement(QoreIdReactButtonManager
13
+ //@ts-ignore
14
+ , {
15
+ ref: ref
16
+ })));
17
+ });
18
+ function useQoreId(ref, options) {
19
+ const onSubmitted = useCallback(data => options.onSubmitted && options.onSubmitted(data), [options]);
20
+ const onError = useCallback(data => options.onError && options.onError(data), [options]);
21
+ useEffect(() => {
22
+ var _UIManager$QoreIdReac, _UIManager$QoreIdReac2;
23
+ const buttonStyles = JSON.stringify(options.buttonProps);
24
+ UIManager.dispatchViewManagerCommand(findNodeHandle(ref.current), // we are calling the 'create' command
25
+ //@ts-ignore
26
+ UIManager === null || UIManager === void 0 ? void 0 : (_UIManager$QoreIdReac = UIManager.QoreIdReactButtonManager) === null || _UIManager$QoreIdReac === void 0 ? void 0 : (_UIManager$QoreIdReac2 = _UIManager$QoreIdReac.Commands) === null || _UIManager$QoreIdReac2 === void 0 ? void 0 : _UIManager$QoreIdReac2.create.toString(), [findNodeHandle(ref.current), options.clientId, buttonStyles]);
27
+ }, []);
28
+ useEffect(() => {
29
+ const eventEmitter = new NativeEventEmitter(NativeModules.QoreidSdk);
30
+ let eventListener = eventEmitter.addListener('onResult', event => {
31
+ if (event !== null && event !== void 0 && event.code) {
32
+ onError && onError(event);
33
+ return;
34
+ }
35
+ onSubmitted && onSubmitted(event);
36
+ });
37
+ return () => {
38
+ eventListener.remove();
39
+ };
40
+ }, []);
41
+ }
42
+ const onChangeData = (ref, data) => {
43
+ const stringified = JSON.stringify(data);
44
+ return useEffect(() => {
45
+ var _UIManager$QoreIdReac3, _UIManager$QoreIdReac4;
46
+ UIManager.dispatchViewManagerCommand(findNodeHandle(ref.current), // we are calling the 'create' command
47
+ //@ts-ignore
48
+ UIManager === null || UIManager === void 0 ? void 0 : (_UIManager$QoreIdReac3 = UIManager.QoreIdReactButtonManager) === null || _UIManager$QoreIdReac3 === void 0 ? void 0 : (_UIManager$QoreIdReac4 = _UIManager$QoreIdReac3.Commands) === null || _UIManager$QoreIdReac4 === void 0 ? void 0 : _UIManager$QoreIdReac4.update.toString(), [stringified]);
49
+ }, [stringified]);
50
+ };
51
+ export const QoreIdButton = initialData => {
52
+ var _initialData$ocrAccep;
53
+ const ref = useRef(null);
54
+ useQoreId(ref, {
55
+ clientId: initialData.clientId,
56
+ onError(data) {
57
+ initialData.onQoreIDSdkError && initialData.onQoreIDSdkError(data);
58
+ },
59
+ onSubmitted(data) {
60
+ initialData.onQoreIDSdkSubmitted && initialData.onQoreIDSdkSubmitted(data);
61
+ },
62
+ buttonProps: {
63
+ title: initialData.title
64
+ }
65
+ });
66
+ onChangeData(ref, {
67
+ config: {
68
+ flowId: initialData.flowId || 0,
69
+ customerRef: initialData.customerReference,
70
+ productCode: initialData.productCode,
71
+ clientId: initialData.clientId
72
+ },
73
+ applicantData: {
74
+ ...initialData.applicantData
75
+ },
76
+ addressData: {
77
+ ...initialData.addressData
78
+ },
79
+ acceptedDocuments: (_initialData$ocrAccep = initialData.ocrAcceptedDocuments) === null || _initialData$ocrAccep === void 0 ? void 0 : _initialData$ocrAccep.split(','),
80
+ identityData: {
81
+ ...initialData.identityData
82
+ }
83
+ });
84
+ return /*#__PURE__*/React.createElement(Button, {
85
+ ref: ref
86
+ });
87
+ };
88
+ //# sourceMappingURL=qoreIdButton.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","forwardRef","useCallback","useEffect","useRef","UIManager","findNodeHandle","requireNativeComponent","View","NativeEventEmitter","NativeModules","QoreIdReactButtonManager","Button","_props","ref","createElement","Fragment","style","position","margin","height","borderWidth","useQoreId","options","onSubmitted","data","onError","_UIManager$QoreIdReac","_UIManager$QoreIdReac2","buttonStyles","JSON","stringify","buttonProps","dispatchViewManagerCommand","current","Commands","create","toString","clientId","eventEmitter","QoreidSdk","eventListener","addListener","event","code","remove","onChangeData","stringified","_UIManager$QoreIdReac3","_UIManager$QoreIdReac4","update","QoreIdButton","initialData","_initialData$ocrAccep","onQoreIDSdkError","onQoreIDSdkSubmitted","title","config","flowId","customerRef","customerReference","productCode","applicantData","addressData","acceptedDocuments","ocrAcceptedDocuments","split","identityData"],"sourceRoot":"../../src","sources":["qoreIdButton.android.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAEVC,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,MAAM,QACD,OAAO;AACd,SACEC,SAAS,EACTC,cAAc,EACdC,sBAAsB,EACtBC,IAAI,EACJC,kBAAkB,EAClBC,aAAa,QACR,cAAc;AAIrB,MAAMC,wBAAwB,GAAGJ,sBAAsB,CAEpD,0BAA0B,CAAC;AAE9B,MAAMK,MAAM,gBAAGX,UAAU,CAKvB,CAACY,MAAM,EAAEC,GAAG,KAAK;EACjB,oBACEd,KAAA,CAAAe,aAAA,CAAAf,KAAA,CAAAgB,QAAA,qBACEhB,KAAA,CAAAe,aAAA,CAACP,IAAI;IACHS,KAAK,EAAE;MACLC,QAAQ,EAAE,UAAU;MACpBC,MAAM,EAAE,MAAM;MACdC,MAAM,EAAE,EAAE;MACVC,WAAW,EAAE;IACf;EAAE,gBAEFrB,KAAA,CAAAe,aAAA,CAACJ;EACC;EAAA;IACAG,GAAG,EAAEA;EAAI,EACT,CACG,CACN;AAEP,CAAC,CAAC;AAEF,SAASQ,SAASA,CAACR,GAAmB,EAAES,OAAgB,EAAE;EACxD,MAAMC,WAAW,GAAGtB,WAAW,CAC5BuB,IAAI,IAAKF,OAAO,CAACC,WAAW,IAAID,OAAO,CAACC,WAAW,CAACC,IAAI,CAAC,EAC1D,CAACF,OAAO,CAAC,CACV;EACD,MAAMG,OAAO,GAAGxB,WAAW,CACxBuB,IAAI,IAAKF,OAAO,CAACG,OAAO,IAAIH,OAAO,CAACG,OAAO,CAACD,IAAI,CAAC,EAClD,CAACF,OAAO,CAAC,CACV;EAEDpB,SAAS,CAAC,MAAM;IAAA,IAAAwB,qBAAA,EAAAC,sBAAA;IACd,MAAMC,YAAY,GAAGC,IAAI,CAACC,SAAS,CAACR,OAAO,CAACS,WAAW,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;IAAa;EAC9C,CAAC,CAAC;EACF,oBAAOnE,KAAA,CAAAe,aAAA,CAACH,MAAM;IAACE,GAAG,EAAEA;EAAI,EAAG;AAC7B,CAAC"}
@@ -0,0 +1,121 @@
1
+ import React, { useState } from 'react';
2
+ import { Text, Platform, Alert, SafeAreaView } from 'react-native';
3
+ import WebView from 'react-native-webview';
4
+ import { Dimensions } from 'react-native';
5
+ import { TouchableOpacity } from 'react-native';
6
+ export const QoreIdButton = initialData => {
7
+ var _initialData$applican, _initialData$applican2, _initialData$applican3, _initialData$applican4, _initialData$applican5, _initialData$applican6, _initialData$identity, _initialData$identity2, _initialData$addressD, _initialData$addressD2, _initialData$addressD3;
8
+ const [canShowWebView, setCanShowWebView] = useState(false);
9
+ const toggleWebView = () => setCanShowWebView(prev => !prev);
10
+ const onMessage = _ref => {
11
+ var _browserEventData;
12
+ let {
13
+ nativeEvent
14
+ } = _ref;
15
+ let browserEventData = null;
16
+ try {
17
+ browserEventData = JSON.parse((nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.data) || '');
18
+ } catch (error) {
19
+ console.error(error.message);
20
+ }
21
+ switch ((_browserEventData = browserEventData) === null || _browserEventData === void 0 ? void 0 : _browserEventData.type) {
22
+ case 'qoreid:verificationSubmitted':
23
+ if (initialData.onQoreIDSdkSubmitted) initialData.onQoreIDSdkSubmitted(browserEventData);
24
+ break;
25
+ case 'qoreid:verificationError':
26
+ if (initialData.onQoreIDSdkError) initialData.onQoreIDSdkError(browserEventData);
27
+ break;
28
+ case 'qoreid:verificationClosed':
29
+ setCanShowWebView(false);
30
+ if (initialData.onQoreIDSdkClosed) initialData.onQoreIDSdkClosed(browserEventData);
31
+ break;
32
+ }
33
+ };
34
+ const html = `
35
+ <!DOCTYPE html>
36
+ <html>
37
+ <head>
38
+ <meta charset="UTF-8" />
39
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
40
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
41
+ <meta name="description" content="QoreID Web SDK" />
42
+ <title>QoreID | Web SDK</title>
43
+ </head>
44
+ <body>
45
+ <qoreid-button
46
+ id="QoreIDButton"
47
+ title="Verify"
48
+ sdkSource="${Platform.OS === 'ios' ? 'ios_sdk' : 'android_sdk'}"
49
+ flowId="${initialData.flowId || 0}"
50
+ clientId="${initialData.clientId}"
51
+ productCode="${initialData.productCode}"
52
+ customerReference="${initialData.customerReference}"
53
+ applicantData='{"firstname": "${initialData === null || initialData === void 0 ? void 0 : (_initialData$applican = initialData.applicantData) === null || _initialData$applican === void 0 ? void 0 : _initialData$applican.firstName}", "middlename": "${initialData === null || initialData === void 0 ? void 0 : (_initialData$applican2 = initialData.applicantData) === null || _initialData$applican2 === void 0 ? void 0 : _initialData$applican2.middleName}", "lastname": "${initialData === null || initialData === void 0 ? void 0 : (_initialData$applican3 = initialData.applicantData) === null || _initialData$applican3 === void 0 ? void 0 : _initialData$applican3.lastName}", "gender": "${initialData === null || initialData === void 0 ? void 0 : (_initialData$applican4 = initialData.applicantData) === null || _initialData$applican4 === void 0 ? void 0 : _initialData$applican4.gender}", "phone": "${initialData === null || initialData === void 0 ? void 0 : (_initialData$applican5 = initialData.applicantData) === null || _initialData$applican5 === void 0 ? void 0 : _initialData$applican5.phoneNumber}", "email": "${initialData === null || initialData === void 0 ? void 0 : (_initialData$applican6 = initialData.applicantData) === null || _initialData$applican6 === void 0 ? void 0 : _initialData$applican6.email}"}'
54
+ identityData='{"idType": "${initialData === null || initialData === void 0 ? void 0 : (_initialData$identity = initialData.identityData) === null || _initialData$identity === void 0 ? void 0 : _initialData$identity.idType}", "idNumber": "${initialData === null || initialData === void 0 ? void 0 : (_initialData$identity2 = initialData.identityData) === null || _initialData$identity2 === void 0 ? void 0 : _initialData$identity2.idNumber}"}'
55
+ addressData='{"address": "${initialData === null || initialData === void 0 ? void 0 : (_initialData$addressD = initialData.addressData) === null || _initialData$addressD === void 0 ? void 0 : _initialData$addressD.address}", "city": "${initialData === null || initialData === void 0 ? void 0 : (_initialData$addressD2 = initialData.addressData) === null || _initialData$addressD2 === void 0 ? void 0 : _initialData$addressD2.city}", "lgaName": "${initialData === null || initialData === void 0 ? void 0 : (_initialData$addressD3 = initialData.addressData) === null || _initialData$addressD3 === void 0 ? void 0 : _initialData$addressD3.lga}"}'
56
+ ocrAcceptedDocuments="${initialData === null || initialData === void 0 ? void 0 : initialData.ocrAcceptedDocuments}"
57
+ onQoreIDSdkSubmitted="({type, detail})=>window.ReactNativeWebView.postMessage(JSON.stringify({ type, ...detail }))"
58
+ onQoreIDSdkError="({type, detail})=>window.ReactNativeWebView.postMessage(JSON.stringify({ type, ...detail }))"
59
+ onQoreIDSdkClosed="({type, detail})=>window.ReactNativeWebView.postMessage(JSON.stringify({ type, ...detail }))"
60
+ />
61
+ <script
62
+ type="text/javascript"
63
+ src="https://dev-qoreid.verifynow.ng/qoreid-sdk/qoreid.js"
64
+ ></script>
65
+ </body>
66
+ </html>
67
+ `;
68
+ if (!(initialData.productCode && initialData.clientId) && canShowWebView) {
69
+ Alert.alert('Initialization Error', 'Missing required fiels. e.g product code, customer ref, client Id');
70
+ setCanShowWebView(false);
71
+ return null;
72
+ }
73
+ if (canShowWebView) {
74
+ return /*#__PURE__*/React.createElement(SafeAreaView, {
75
+ style: {
76
+ flex: 1,
77
+ alignSelf: 'stretch',
78
+ position: 'absolute',
79
+ top: 0,
80
+ left: 0,
81
+ right: 0
82
+ }
83
+ }, /*#__PURE__*/React.createElement(WebView, {
84
+ mixedContentMode: "compatibility",
85
+ style: {
86
+ flex: 1,
87
+ marginTop: 40,
88
+ height: Dimensions.get('window').height,
89
+ width: Dimensions.get('screen').width
90
+ },
91
+ bounces: false,
92
+ scalesPageToFit: true,
93
+ javaScriptEnabled: true,
94
+ originWhitelist: ['*'],
95
+ useWebView2: true,
96
+ useWebKit: true,
97
+ onMessage: onMessage,
98
+ source: {
99
+ html
100
+ },
101
+ onError: console.error
102
+ }));
103
+ }
104
+ return initialData.render && initialData.render({
105
+ onPress: toggleWebView
106
+ }) || /*#__PURE__*/React.createElement(TouchableOpacity, {
107
+ style: {
108
+ flex: 1,
109
+ justifyContent: 'center',
110
+ alignItems: 'center',
111
+ paddingHorizontal: 10,
112
+ paddingVertical: 5
113
+ },
114
+ onPress: toggleWebView
115
+ }, /*#__PURE__*/React.createElement(Text, {
116
+ style: {
117
+ color: 'blue'
118
+ }
119
+ }, "Start QoreID"));
120
+ };
121
+ //# sourceMappingURL=qoreIdButton.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useState","Text","Platform","Alert","SafeAreaView","WebView","Dimensions","TouchableOpacity","QoreIdButton","initialData","_initialData$applican","_initialData$applican2","_initialData$applican3","_initialData$applican4","_initialData$applican5","_initialData$applican6","_initialData$identity","_initialData$identity2","_initialData$addressD","_initialData$addressD2","_initialData$addressD3","canShowWebView","setCanShowWebView","toggleWebView","prev","onMessage","_ref","_browserEventData","nativeEvent","browserEventData","JSON","parse","data","error","console","message","type","onQoreIDSdkSubmitted","onQoreIDSdkError","onQoreIDSdkClosed","html","OS","flowId","clientId","productCode","customerReference","applicantData","firstName","middleName","lastName","gender","phoneNumber","email","identityData","idType","idNumber","addressData","address","city","lga","ocrAcceptedDocuments","alert","createElement","style","flex","alignSelf","position","top","left","right","mixedContentMode","marginTop","height","get","width","bounces","scalesPageToFit","javaScriptEnabled","originWhitelist","useWebView2","useWebKit","source","onError","render","onPress","justifyContent","alignItems","paddingHorizontal","paddingVertical","color"],"sourceRoot":"../../src","sources":["qoreIdButton.ios.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,IAAI,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,YAAY,QAAQ,cAAc;AAClE,OAAOC,OAAO,MAA+B,sBAAsB;AAEnE,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,gBAAgB,QAAQ,cAAc;AAE/C,OAAO,MAAMC,YAAqC,GAAIC,WAAW,IAAK;EAAA,IAAAC,qBA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C,CAAE;MACFC,OAAO,EAAE,KAAM;MACfC,eAAe,EAAE,IAAK;MACtBC,iBAAiB,EAAE,IAAK;MACxBC,eAAe,EAAE,CAAC,GAAG,CAAE;MACvBC,WAAW,EAAE,IAAK;MAClBC,SAAS,EAAE,IAAK;MAChBvD,SAAS,EAAEA,SAAU;MACrBwD,MAAM,EAAE;QACNzC;MACF,CAAE;MACF0C,OAAO,EAAEhD,OAAO,CAACD;IAAM,EACvB,CACW;EAEnB;EAEA,OACGxB,WAAW,CAAC0E,MAAM,IAAI1E,WAAW,CAAC0E,MAAM,CAAC;IAAEC,OAAO,EAAE7D;EAAc,CAAC,CAAC,iBACnExB,KAAA,CAAA+D,aAAA,CAACvD,gBAAgB;IACfwD,KAAK,EAAE;MACLC,IAAI,EAAE,CAAC;MACPqB,cAAc,EAAE,QAAQ;MACxBC,UAAU,EAAE,QAAQ;MACpBC,iBAAiB,EAAE,EAAE;MACrBC,eAAe,EAAE;IACnB,CAAE;IACFJ,OAAO,EAAE7D;EAAc,gBAEvBxB,KAAA,CAAA+D,aAAA,CAAC7D,IAAI;IAAC8D,KAAK,EAAE;MAAE0B,KAAK,EAAE;IAAO;EAAE,GAAC,cAAY,CAAO,CAEtD;AAEL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=react-native-qoreid-sdk.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["react-native-qoreid-sdk.d.ts"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.d.ts"],"mappings":""}
@@ -0,0 +1,13 @@
1
+ const acceptedDocuments = {
2
+ Nigeria: ['DRIVERS_LICENSE_NGA', 'VOTERS_CARD_NGA', 'NIN_SLIP_NGA', 'PASSPORT_NGA'],
3
+ Ghana: ['DRIVERS_LICENSE_GHA', 'NHIS_CARD_GHA', 'ECOWAS_CARD_GHA', 'SOCIAL_SECURITY_GHA', 'VOTERS_CARD_GHA', 'PASSPORT_GHA', 'GHANA_CARD_GHA'],
4
+ Kenya: ['DRIVERS_LICENSE_KEN', 'NATIONAL_ID_KEN', 'REFUGEE_ID_KEN', 'PASSPORT_KEN']
5
+ };
6
+ const productCodes = ['alien_card', 'brs', 'business_address', 'bvn_basic', 'bvn_boolean', 'bvn_nuban', 'bvn_premium', 'cac_basic', 'cac_premium', 'drivers_license', 'employment', 'guarantor', 'face_verification_bvn', 'face_verification_drivers_license', 'face_verification_nin', 'face_verification_passport_ng', 'face_verification_passport_ke', 'face_verification_vnin', 'individual_address', 'kenya_id', 'license_plate_basic', 'license_plate_premium', 'liveness', 'liveness_bvn', 'liveness_drivers_license', 'liveness_nin', 'liveness_ocr', 'liveness_passport_ng', 'liveness_vnin', 'nin', 'nin_phone', 'nuban', 'ocr', 'passport_ng', 'passport_ke', 'property', 'tin',
7
+ // "vehicle",
8
+ 'verifind', 'verifind_4d', 'vin', 'virtual_nin'];
9
+ export const utils = {
10
+ productCodes,
11
+ acceptedDocuments
12
+ };
13
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["acceptedDocuments","Nigeria","Ghana","Kenya","productCodes","utils"],"sourceRoot":"../../src","sources":["utils.ts"],"mappings":"AAAA,MAAMA,iBAAiB,GAAG;EACxBC,OAAO,EAAE,CACP,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,cAAc,CACf;EACDC,KAAK,EAAE,CACL,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,CACjB;EACDC,KAAK,EAAE,CACL,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc;AAElB,CAAC;AAED,MAAMC,YAAY,GAAG,CACnB,YAAY,EACZ,KAAK,EACL,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,WAAW,EACX,aAAa,EACb,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,uBAAuB,EACvB,mCAAmC,EACnC,uBAAuB,EACvB,+BAA+B,EAC/B,+BAA+B,EAC/B,wBAAwB,EACxB,oBAAoB,EACpB,UAAU,EACV,qBAAqB,EACrB,uBAAuB,EACvB,UAAU,EACV,cAAc,EACd,0BAA0B,EAC1B,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,KAAK,EACL,WAAW,EACX,OAAO,EACP,KAAK,EACL,aAAa,EACb,aAAa,EACb,UAAU,EACV,KAAK;AACL;AACA,UAAU,EACV,aAAa,EACb,KAAK,EACL,aAAa,CACd;AAED,OAAO,MAAMC,KAAK,GAAG;EACnBD,YAAY;EACZJ;AACF,CAAC"}
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { IQoreIdButton } from './types';
3
+ export declare const QoreIdButton: import("react").FC<IQoreIdButton<JSX.Element>>;
4
+ export * from './utils';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,YAAY,gDAIoD,CAAC;AAE9E,cAAc,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { IQoreIdButton } from './types';
3
+ export declare const QoreIdButton: React.FC<IQoreIdButton>;
4
+ //# sourceMappingURL=qoreIdButton.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qoreIdButton.android.d.ts","sourceRoot":"","sources":["../../src/qoreIdButton.android.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAmC,aAAa,EAAE,MAAM,SAAS,CAAC;AAsF9E,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAkChD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { IQoreIdButton } from './types';
3
+ export declare const QoreIdButton: React.FC<IQoreIdButton>;
4
+ //# sourceMappingURL=qoreIdButton.ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qoreIdButton.ios.d.ts","sourceRoot":"","sources":["../../src/qoreIdButton.ios.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA8IhD,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare const utils: {
2
+ productCodes: string[];
3
+ acceptedDocuments: {
4
+ Nigeria: string[];
5
+ Ghana: string[];
6
+ Kenya: string[];
7
+ };
8
+ };
9
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAqEA,eAAO,MAAM,KAAK;;;;;;;CAGjB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,165 @@
1
+ {
2
+ "name": "@qore-id/react-native-qoreid-sdk",
3
+ "version": "0.1.0-snapshot",
4
+ "description": "QoreId React Native SDK",
5
+ "main": "lib/commonjs/index",
6
+ "module": "lib/module/index",
7
+ "types": "lib/typescript/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
+ "files": [
11
+ "src",
12
+ "lib",
13
+ "android",
14
+ "ios",
15
+ "cpp",
16
+ "*.podspec",
17
+ "!lib/typescript/example",
18
+ "!ios/build",
19
+ "!android/build",
20
+ "!android/gradle",
21
+ "!android/gradlew",
22
+ "!android/gradlew.bat",
23
+ "!android/local.properties",
24
+ "!**/__tests__",
25
+ "!**/__fixtures__",
26
+ "!**/__mocks__",
27
+ "!**/.*"
28
+ ],
29
+ "scripts": {
30
+ "test": "jest",
31
+ "typecheck": "tsc --noEmit",
32
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
33
+ "prepack": "bob build",
34
+ "release": "release-it",
35
+ "example": "yarn --cwd example",
36
+ "bootstrap": "yarn example && yarn install && yarn example pods",
37
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
38
+ },
39
+ "keywords": [
40
+ "react-native",
41
+ "ios",
42
+ "android"
43
+ ],
44
+ "repository": "https://",
45
+ "author": "Emmanuel Ugwuoke <e.ugwuoke@verifyme.ng> (https://)",
46
+ "org": "qore-id",
47
+ "license": "MIT",
48
+ "bugs": {
49
+ "url": "https:///issues"
50
+ },
51
+ "homepage": "https://#readme",
52
+ "publishConfig": {
53
+ "registry": "https://registry.npmjs.org/"
54
+ },
55
+ "devDependencies": {
56
+ "@commitlint/config-conventional": "^17.0.2",
57
+ "@evilmartians/lefthook": "^1.2.2",
58
+ "@react-native-community/eslint-config": "^3.0.2",
59
+ "@release-it/conventional-changelog": "^5.0.0",
60
+ "@types/jest": "^28.1.2",
61
+ "@types/react": "~17.0.21",
62
+ "@types/react-native": "0.70.0",
63
+ "commitlint": "^17.0.2",
64
+ "del-cli": "^5.0.0",
65
+ "eslint": "^8.4.1",
66
+ "eslint-config-prettier": "^8.5.0",
67
+ "eslint-plugin-prettier": "^4.0.0",
68
+ "jest": "^28.1.1",
69
+ "pod-install": "^0.1.0",
70
+ "prettier": "^2.0.5",
71
+ "react": "18.2.0",
72
+ "react-native": "0.71.6",
73
+ "react-native-builder-bob": "^0.20.0",
74
+ "release-it": "^15.0.0",
75
+ "typescript": "^4.5.2"
76
+ },
77
+ "resolutions": {
78
+ "@types/react": "17.0.21"
79
+ },
80
+ "peerDependencies": {
81
+ "react": "*",
82
+ "react-native": "*",
83
+ "react-native-webview":"*"
84
+ },
85
+ "engines": {
86
+ "node": ">= 16.0.0"
87
+ },
88
+ "packageManager": "^yarn@1.22.15",
89
+ "jest": {
90
+ "preset": "react-native",
91
+ "modulePathIgnorePatterns": [
92
+ "<rootDir>/example/node_modules",
93
+ "<rootDir>/lib/"
94
+ ]
95
+ },
96
+ "commitlint": {
97
+ "extends": [
98
+ "@commitlint/config-conventional"
99
+ ]
100
+ },
101
+ "release-it": {
102
+ "git": {
103
+ "commitMessage": "chore: release ${version}",
104
+ "tagName": "v${version}"
105
+ },
106
+ "npm": {
107
+ "publish": true
108
+ },
109
+ "github": {
110
+ "release": true
111
+ },
112
+ "plugins": {
113
+ "@release-it/conventional-changelog": {
114
+ "preset": "angular"
115
+ }
116
+ }
117
+ },
118
+ "eslintConfig": {
119
+ "root": true,
120
+ "extends": [
121
+ "@react-native-community",
122
+ "prettier"
123
+ ],
124
+ "rules": {
125
+ "prettier/prettier": [
126
+ "error",
127
+ {
128
+ "quoteProps": "consistent",
129
+ "singleQuote": true,
130
+ "tabWidth": 2,
131
+ "trailingComma": "es5",
132
+ "useTabs": false
133
+ }
134
+ ]
135
+ }
136
+ },
137
+ "eslintIgnore": [
138
+ "node_modules/",
139
+ "lib/"
140
+ ],
141
+ "prettier": {
142
+ "quoteProps": "consistent",
143
+ "singleQuote": true,
144
+ "tabWidth": 2,
145
+ "trailingComma": "es5",
146
+ "useTabs": false
147
+ },
148
+ "react-native-builder-bob": {
149
+ "source": "src",
150
+ "output": "lib",
151
+ "targets": [
152
+ "commonjs",
153
+ "module",
154
+ [
155
+ "typescript",
156
+ {
157
+ "project": "tsconfig.build.json"
158
+ }
159
+ ]
160
+ ]
161
+ },
162
+ "dependencies": {
163
+ "react-native-webview": "^12.0.2"
164
+ }
165
+ }
@@ -0,0 +1,35 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5
+
6
+ Pod::Spec.new do |s|
7
+ s.name = "@qore-id/react-native-qoreid-sdk"
8
+ s.version = package["version"]
9
+ s.summary = package["description"]
10
+ s.homepage = package["homepage"]
11
+ s.license = package["license"]
12
+ s.authors = package["author"]
13
+
14
+ s.platforms = { :ios => "11.0" }
15
+ s.source = { :git => "https://.git", :tag => "#{s.version}" }
16
+
17
+ s.source_files = "ios/**/*.{h,m,mm}"
18
+
19
+ s.dependency "React-Core"
20
+
21
+ # Don't install the dependencies when we run `pod install` in the old architecture.
22
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
23
+ s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
24
+ s.pod_target_xcconfig = {
25
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
26
+ "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
27
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
28
+ }
29
+ s.dependency "React-Codegen"
30
+ s.dependency "RCT-Folly"
31
+ s.dependency "RCTRequired"
32
+ s.dependency "RCTTypeSafety"
33
+ s.dependency "ReactCommon/turbomodule/core"
34
+ end
35
+ end
package/src/index.tsx ADDED
@@ -0,0 +1,10 @@
1
+ import { Platform } from 'react-native';
2
+ import type { IQoreIdButton } from './types';
3
+
4
+ export const QoreIdButton =
5
+ Platform.OS === 'android'
6
+ ? (require('./qoreIdButton.android')
7
+ .QoreIdButton as React.FC<IQoreIdButton>)
8
+ : (require('./qoreIdButton.ios').QoreIdButton as React.FC<IQoreIdButton>);
9
+
10
+ export * from './utils';