@qore-id/react-native-qoreid-sdk 1.0.9 → 1.1.1

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 (51) hide show
  1. package/README.md +1 -211
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/AndroidManifest.xml +0 -1
  4. package/android/src/main/java/com/qoreidsdk/QoreidSdkModule.kt +45 -34
  5. package/ios/QoreidSdk-Bridging-Header.h +7 -0
  6. package/ios/QoreidSdk.m +21 -0
  7. package/ios/QoreidSdk.swift +137 -0
  8. package/ios/QoreidSdk.xcodeproj/project.pbxproj +22 -4
  9. package/ios/QoreidSdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  10. package/ios/QoreidSdk.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +5 -0
  11. package/ios/QoreidSdk.xcodeproj/project.xcworkspace/xcuserdata/e.ugwuoke.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  12. package/ios/QoreidSdk.xcodeproj/project.xcworkspace/xcuserdata/e.ugwuoke.xcuserdatad/WorkspaceSettings.xcsettings +14 -0
  13. package/ios/QoreidSdk.xcodeproj/xcuserdata/e.ugwuoke.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  14. package/ios/ViewController.swift +22 -0
  15. package/lib/commonjs/index.js +10 -42
  16. package/lib/commonjs/index.js.map +1 -1
  17. package/lib/commonjs/qoreIdSdk.js +48 -0
  18. package/lib/commonjs/qoreIdSdk.js.map +1 -0
  19. package/lib/commonjs/types.d.js +0 -4
  20. package/lib/commonjs/utils.js +1 -2
  21. package/lib/commonjs/utils.js.map +1 -1
  22. package/lib/module/index.js +1 -35
  23. package/lib/module/index.js.map +1 -1
  24. package/lib/module/qoreIdSdk.js +42 -0
  25. package/lib/module/qoreIdSdk.js.map +1 -0
  26. package/lib/module/types.d.js +1 -1
  27. package/lib/typescript/index.d.ts +1 -2
  28. package/lib/typescript/index.d.ts.map +1 -1
  29. package/lib/typescript/qoreIdSdk.d.ts +15 -0
  30. package/lib/typescript/qoreIdSdk.d.ts.map +1 -0
  31. package/package.json +3 -7
  32. package/qore-id-react-native-qoreid-sdk.podspec +4 -4
  33. package/src/index.tsx +1 -48
  34. package/src/qoreIdSdk.tsx +47 -0
  35. package/src/types.d.ts +13 -57
  36. package/android/Untitled +0 -0
  37. package/ios/QoreidSdk.h +0 -12
  38. package/ios/QoreidSdk.mm +0 -27
  39. package/lib/commonjs/qoreIdButton.android.js +0 -105
  40. package/lib/commonjs/qoreIdButton.android.js.map +0 -1
  41. package/lib/commonjs/qoreIdButton.ios.js +0 -129
  42. package/lib/commonjs/qoreIdButton.ios.js.map +0 -1
  43. package/lib/module/qoreIdButton.android.js +0 -95
  44. package/lib/module/qoreIdButton.android.js.map +0 -1
  45. package/lib/module/qoreIdButton.ios.js +0 -121
  46. package/lib/module/qoreIdButton.ios.js.map +0 -1
  47. package/lib/typescript/qoreIdButton.android.d.ts +0 -18
  48. package/lib/typescript/qoreIdButton.android.d.ts.map +0 -1
  49. package/lib/typescript/qoreIdButton.ios.d.ts +0 -4
  50. package/lib/typescript/qoreIdButton.ios.d.ts.map +0 -1
  51. package/src/qoreIdButton.android.tsx +0 -139
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>QoreidSdk.xcscheme_^#shared#^_</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ </dict>
13
+ </dict>
14
+ </plist>
@@ -0,0 +1,22 @@
1
+ //
2
+ // ViewController.swift
3
+ // qore-id-react-native-qoreid-sdk
4
+ //
5
+ // Created by Guru King on 03/10/2023.
6
+ //
7
+
8
+ import UIKit
9
+ import QoreIDSDK
10
+
11
+ class ViewController: UIViewController {
12
+ var param:QoreIDParam?
13
+ var onQoreIdResult:((QoreIDResult) -> ())?
14
+
15
+
16
+ override func viewDidLoad() {
17
+ super.viewDidLoad()
18
+ QoreIdSdk.shared.launch(param: param ?? QoreIDParam(), vc: self, "react_native_ios_sdk") { [weak self] result in
19
+ self?.onQoreIdResult!(result)
20
+ }
21
+ }
22
+ }
@@ -3,17 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- var _exportNames = {
7
- QoreIdButton: true,
8
- QoreIdSdk: true
9
- };
10
- exports.QoreIdSdk = exports.QoreIdButton = void 0;
11
- var _reactNative = require("react-native");
12
- var _react = _interopRequireDefault(require("react"));
13
6
  var _utils = require("./utils");
14
7
  Object.keys(_utils).forEach(function (key) {
15
8
  if (key === "default" || key === "__esModule") return;
16
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
17
9
  if (key in exports && exports[key] === _utils[key]) return;
18
10
  Object.defineProperty(exports, key, {
19
11
  enumerable: true,
@@ -22,39 +14,15 @@ Object.keys(_utils).forEach(function (key) {
22
14
  }
23
15
  });
24
16
  });
25
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26
- //Safe fail implementation for iOS
27
- const QoreIdButtonIOS = initialData => {
28
- console.info('No implementation for iOS');
29
- return initialData.render && initialData.render({
30
- onPress: () => {}
31
- }) || /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
32
- style: {
33
- flex: 1,
34
- justifyContent: 'center',
35
- alignItems: 'center',
36
- paddingHorizontal: 10,
37
- paddingVertical: 5
38
- }
39
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
40
- style: {
41
- color: 'blue'
17
+ var _qoreIdSdk = require("./qoreIdSdk");
18
+ Object.keys(_qoreIdSdk).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _qoreIdSdk[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _qoreIdSdk[key];
42
25
  }
43
- }, "Start QoreID"));
44
- };
45
-
46
- // (require('./qoreIdButton.ios').QoreIdButton as React.FC<IQoreIdButton>);
47
-
48
- const QoreIdSdkIOS = {
49
- launchQoreId: _data => {
50
- console.info('No implementation for iOS');
51
- },
52
- events: (_onSuccess, _onError) => {
53
- console.info('No implementation for iOS');
54
- }
55
- };
56
- const QoreIdButton = _reactNative.Platform.OS === 'android' ? require('./qoreIdButton.android').QoreIdButton : QoreIdButtonIOS;
57
- exports.QoreIdButton = QoreIdButton;
58
- const QoreIdSdk = _reactNative.Platform.OS === 'android' ? require('./qoreIdButton.android').QoreIdSdk : QoreIdSdkIOS;
59
- exports.QoreIdSdk = QoreIdSdk;
26
+ });
27
+ });
60
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_utils","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","obj","__esModule","default","QoreIdButtonIOS","initialData","console","info","render","onPress","createElement","TouchableOpacity","style","flex","justifyContent","alignItems","paddingHorizontal","paddingVertical","Text","color","QoreIdSdkIOS","launchQoreId","_data","events","_onSuccess","_onError","QoreIdButton","Platform","OS","QoreIdSdk"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAwBA,IAAAG,MAAA,GAAAH,OAAA;AAAAI,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAAwB,SAAAL,uBAAAc,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAtBxB;AACA,MAAMG,eAAwC,GAAIC,WAAW,IAAK;EAChEC,OAAO,CAACC,IAAI,CAAC,2BAA2B,CAAC;EACzC,OACGF,WAAW,CAACG,MAAM,IAAIH,WAAW,CAACG,MAAM,CAAC;IAAEC,OAAO,EAAEA,CAAA,KAAM,CAAC;EAAE,CAAC,CAAC,iBAC9DvB,MAAA,CAAAiB,OAAA,CAAAO,aAAA,CAAC1B,YAAA,CAAA2B,gBAAgB;IACfC,KAAK,EAAE;MACLC,IAAI,EAAE,CAAC;MACPC,cAAc,EAAE,QAAQ;MACxBC,UAAU,EAAE,QAAQ;MACpBC,iBAAiB,EAAE,EAAE;MACrBC,eAAe,EAAE;IACnB;EAAE,gBAEF/B,MAAA,CAAAiB,OAAA,CAAAO,aAAA,CAAC1B,YAAA,CAAAkC,IAAI;IAACN,KAAK,EAAE;MAAEO,KAAK,EAAE;IAAO;EAAE,GAAC,cAAY,CAAO,CAEtD;AAEL,CAAC;;AAED;;AAIA,MAAMC,YAAY,GAAG;EACnBC,YAAY,EAAGC,KAAc,IAAK;IAChChB,OAAO,CAACC,IAAI,CAAC,2BAA2B,CAAC;EAC3C,CAAC;EACDgB,MAAM,EAAEA,CACNC,UAAmC,EACnCC,QAAiC,KAC9B;IACHnB,OAAO,CAACC,IAAI,CAAC,2BAA2B,CAAC;EAC3C;AACF,CAAC;AAEM,MAAMmB,YAAY,GACvBC,qBAAQ,CAACC,EAAE,KAAK,SAAS,GACrB3C,OAAO,CAAC,wBAAwB,CAAC,CAACyC,YAAY,GAC9CtB,eAAe;AAACP,OAAA,CAAA6B,YAAA,GAAAA,YAAA;AAEf,MAAMG,SAAS,GACpBF,qBAAQ,CAACC,EAAE,KAAK,SAAS,GACrB3C,OAAO,CAAC,wBAAwB,CAAC,CAAC4C,SAAS,GAC3CT,YAAY;AAACvB,OAAA,CAAAgC,SAAA,GAAAA,SAAA"}
1
+ {"version":3,"names":["_utils","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_qoreIdSdk"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,UAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,UAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,UAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,UAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.QoreIdSdk = void 0;
7
+ var _reactNative = require("react-native");
8
+ const QoreIdSdk = exports.QoreIdSdk = {
9
+ /**
10
+ * lauches QoreID SDK
11
+ * @param initialData - data to launch Qore ID SDK
12
+ * @requires QoreIdSdk native module installed
13
+ */
14
+ launch(initialData, _callback) {
15
+ const payload = {
16
+ config: {
17
+ flowId: initialData.flowId || 0,
18
+ customerReference: initialData.customerReference,
19
+ productCode: initialData.productCode,
20
+ clientId: initialData.clientId,
21
+ defaultIdType: (initialData === null || initialData === void 0 ? void 0 : initialData.defaultIdType) || ''
22
+ },
23
+ applicantData: {
24
+ ...initialData.applicantData
25
+ },
26
+ addressData: {
27
+ ...initialData.addressData
28
+ },
29
+ acceptedDocuments: initialData.ocrAcceptedDocuments,
30
+ identityData: {
31
+ ...initialData.identityData
32
+ }
33
+ };
34
+ _reactNative.NativeModules.QoreidSdk.launchQoreidSdk(payload);
35
+ },
36
+ /**
37
+ * QoreIdSdk events listener. It takes callbacks to handle success and error events
38
+ * @param callback(data: OnResultType) Handles various events from QoreID SDK
39
+ */
40
+ events(callback) {
41
+ const eventEmitter = _reactNative.Platform.OS === 'android' ? new _reactNative.NativeEventEmitter() : new _reactNative.NativeEventEmitter(_reactNative.NativeModules.QoreidSdk);
42
+ let eventListener = eventEmitter === null || eventEmitter === void 0 ? void 0 : eventEmitter.addListener('onResult', callback);
43
+ return () => {
44
+ eventListener.remove();
45
+ };
46
+ }
47
+ };
48
+ //# sourceMappingURL=qoreIdSdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","QoreIdSdk","exports","launch","initialData","_callback","payload","config","flowId","customerReference","productCode","clientId","defaultIdType","applicantData","addressData","acceptedDocuments","ocrAcceptedDocuments","identityData","NativeModules","QoreidSdk","launchQoreidSdk","events","callback","eventEmitter","Platform","OS","NativeEventEmitter","eventListener","addListener","remove"],"sourceRoot":"../../src","sources":["qoreIdSdk.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGO,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACvB;AACF;AACA;AACA;AACA;EACEE,MAAMA,CAACC,WAAuB,EAAEC,SAAoC,EAAE;IACpE,MAAMC,OAAO,GAAG;MACdC,MAAM,EAAE;QACNC,MAAM,EAAEJ,WAAW,CAACI,MAAM,IAAI,CAAC;QAC/BC,iBAAiB,EAAEL,WAAW,CAACK,iBAAiB;QAChDC,WAAW,EAAEN,WAAW,CAACM,WAAW;QACpCC,QAAQ,EAAEP,WAAW,CAACO,QAAQ;QAC9BC,aAAa,EAAE,CAAAR,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEQ,aAAa,KAAI;MAC/C,CAAC;MACDC,aAAa,EAAE;QACb,GAAGT,WAAW,CAACS;MACjB,CAAC;MACDC,WAAW,EAAE;QACX,GAAGV,WAAW,CAACU;MACjB,CAAC;MACDC,iBAAiB,EAAEX,WAAW,CAACY,oBAAoB;MACnDC,YAAY,EAAE;QAAE,GAAGb,WAAW,CAACa;MAAa;IAC9C,CAAC;IAEDC,0BAAa,CAACC,SAAS,CAACC,eAAe,CAACd,OAAO,CAAC;EAClD,CAAC;EAED;AACF;AACA;AACA;EACEe,MAAMA,CAACC,QAAkC,EAAE;IACzC,MAAMC,YAAY,GAChBC,qBAAQ,CAACC,EAAE,KAAK,SAAS,GACrB,IAAIC,+BAAkB,CAAC,CAAC,GACxB,IAAIA,+BAAkB,CAACR,0BAAa,CAACC,SAAS,CAAC;IACrD,IAAIQ,aAAa,GAAGJ,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEK,WAAW,CAAC,UAAU,EAAEN,QAAQ,CAAC;IAEnE,OAAO,MAAM;MACXK,aAAa,CAACE,MAAM,CAAC,CAAC;IACxB,CAAC;EACH;AACF,CAAC"}
@@ -1,6 +1,2 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
2
  //# sourceMappingURL=types.d.js.map
@@ -12,9 +12,8 @@ const acceptedDocuments = {
12
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
13
  // "vehicle",
14
14
  'verifind', 'verifind_4d', 'vin', 'virtual_nin'];
15
- const utils = {
15
+ const utils = exports.utils = {
16
16
  productCodes,
17
17
  acceptedDocuments
18
18
  };
19
- exports.utils = utils;
20
19
  //# sourceMappingURL=utils.js.map
@@ -1 +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"}
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,GAAAC,OAAA,CAAAD,KAAA,GAAG;EACnBD,YAAY;EACZJ;AACF,CAAC"}
@@ -1,37 +1,3 @@
1
- import { Platform, Text, TouchableOpacity } from 'react-native';
2
- import React from 'react';
3
-
4
- //Safe fail implementation for iOS
5
- const QoreIdButtonIOS = initialData => {
6
- console.info('No implementation for iOS');
7
- return initialData.render && initialData.render({
8
- onPress: () => {}
9
- }) || /*#__PURE__*/React.createElement(TouchableOpacity, {
10
- style: {
11
- flex: 1,
12
- justifyContent: 'center',
13
- alignItems: 'center',
14
- paddingHorizontal: 10,
15
- paddingVertical: 5
16
- }
17
- }, /*#__PURE__*/React.createElement(Text, {
18
- style: {
19
- color: 'blue'
20
- }
21
- }, "Start QoreID"));
22
- };
23
-
24
- // (require('./qoreIdButton.ios').QoreIdButton as React.FC<IQoreIdButton>);
25
-
26
1
  export * from './utils';
27
- const QoreIdSdkIOS = {
28
- launchQoreId: _data => {
29
- console.info('No implementation for iOS');
30
- },
31
- events: (_onSuccess, _onError) => {
32
- console.info('No implementation for iOS');
33
- }
34
- };
35
- export const QoreIdButton = Platform.OS === 'android' ? require('./qoreIdButton.android').QoreIdButton : QoreIdButtonIOS;
36
- export const QoreIdSdk = Platform.OS === 'android' ? require('./qoreIdButton.android').QoreIdSdk : QoreIdSdkIOS;
2
+ export * from './qoreIdSdk';
37
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","Text","TouchableOpacity","React","QoreIdButtonIOS","initialData","console","info","render","onPress","createElement","style","flex","justifyContent","alignItems","paddingHorizontal","paddingVertical","color","QoreIdSdkIOS","launchQoreId","_data","events","_onSuccess","_onError","QoreIdButton","OS","require","QoreIdSdk"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AAE/D,OAAOC,KAAK,MAAM,OAAO;;AAEzB;AACA,MAAMC,eAAwC,GAAIC,WAAW,IAAK;EAChEC,OAAO,CAACC,IAAI,CAAC,2BAA2B,CAAC;EACzC,OACGF,WAAW,CAACG,MAAM,IAAIH,WAAW,CAACG,MAAM,CAAC;IAAEC,OAAO,EAAEA,CAAA,KAAM,CAAC;EAAE,CAAC,CAAC,iBAC9DN,KAAA,CAAAO,aAAA,CAACR,gBAAgB;IACfS,KAAK,EAAE;MACLC,IAAI,EAAE,CAAC;MACPC,cAAc,EAAE,QAAQ;MACxBC,UAAU,EAAE,QAAQ;MACpBC,iBAAiB,EAAE,EAAE;MACrBC,eAAe,EAAE;IACnB;EAAE,gBAEFb,KAAA,CAAAO,aAAA,CAACT,IAAI;IAACU,KAAK,EAAE;MAAEM,KAAK,EAAE;IAAO;EAAE,GAAC,cAAY,CAAO,CAEtD;AAEL,CAAC;;AAED;;AAEA,cAAc,SAAS;AAEvB,MAAMC,YAAY,GAAG;EACnBC,YAAY,EAAGC,KAAc,IAAK;IAChCd,OAAO,CAACC,IAAI,CAAC,2BAA2B,CAAC;EAC3C,CAAC;EACDc,MAAM,EAAEA,CACNC,UAAmC,EACnCC,QAAiC,KAC9B;IACHjB,OAAO,CAACC,IAAI,CAAC,2BAA2B,CAAC;EAC3C;AACF,CAAC;AAED,OAAO,MAAMiB,YAAY,GACvBxB,QAAQ,CAACyB,EAAE,KAAK,SAAS,GACrBC,OAAO,CAAC,wBAAwB,CAAC,CAACF,YAAY,GAC9CpB,eAAe;AAErB,OAAO,MAAMuB,SAAS,GACpB3B,QAAQ,CAACyB,EAAE,KAAK,SAAS,GACrBC,OAAO,CAAC,wBAAwB,CAAC,CAACC,SAAS,GAC3CT,YAAY"}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,cAAc,SAAS;AACvB,cAAc,aAAa"}
@@ -0,0 +1,42 @@
1
+ import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
2
+ export const QoreIdSdk = {
3
+ /**
4
+ * lauches QoreID SDK
5
+ * @param initialData - data to launch Qore ID SDK
6
+ * @requires QoreIdSdk native module installed
7
+ */
8
+ launch(initialData, _callback) {
9
+ const payload = {
10
+ config: {
11
+ flowId: initialData.flowId || 0,
12
+ customerReference: initialData.customerReference,
13
+ productCode: initialData.productCode,
14
+ clientId: initialData.clientId,
15
+ defaultIdType: (initialData === null || initialData === void 0 ? void 0 : initialData.defaultIdType) || ''
16
+ },
17
+ applicantData: {
18
+ ...initialData.applicantData
19
+ },
20
+ addressData: {
21
+ ...initialData.addressData
22
+ },
23
+ acceptedDocuments: initialData.ocrAcceptedDocuments,
24
+ identityData: {
25
+ ...initialData.identityData
26
+ }
27
+ };
28
+ NativeModules.QoreidSdk.launchQoreidSdk(payload);
29
+ },
30
+ /**
31
+ * QoreIdSdk events listener. It takes callbacks to handle success and error events
32
+ * @param callback(data: OnResultType) Handles various events from QoreID SDK
33
+ */
34
+ events(callback) {
35
+ const eventEmitter = Platform.OS === 'android' ? new NativeEventEmitter() : new NativeEventEmitter(NativeModules.QoreidSdk);
36
+ let eventListener = eventEmitter === null || eventEmitter === void 0 ? void 0 : eventEmitter.addListener('onResult', callback);
37
+ return () => {
38
+ eventListener.remove();
39
+ };
40
+ }
41
+ };
42
+ //# sourceMappingURL=qoreIdSdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","Platform","QoreIdSdk","launch","initialData","_callback","payload","config","flowId","customerReference","productCode","clientId","defaultIdType","applicantData","addressData","acceptedDocuments","ocrAcceptedDocuments","identityData","QoreidSdk","launchQoreidSdk","events","callback","eventEmitter","OS","eventListener","addListener","remove"],"sourceRoot":"../../src","sources":["qoreIdSdk.tsx"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAG1E,OAAO,MAAMC,SAAS,GAAG;EACvB;AACF;AACA;AACA;AACA;EACEC,MAAMA,CAACC,WAAuB,EAAEC,SAAoC,EAAE;IACpE,MAAMC,OAAO,GAAG;MACdC,MAAM,EAAE;QACNC,MAAM,EAAEJ,WAAW,CAACI,MAAM,IAAI,CAAC;QAC/BC,iBAAiB,EAAEL,WAAW,CAACK,iBAAiB;QAChDC,WAAW,EAAEN,WAAW,CAACM,WAAW;QACpCC,QAAQ,EAAEP,WAAW,CAACO,QAAQ;QAC9BC,aAAa,EAAE,CAAAR,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEQ,aAAa,KAAI;MAC/C,CAAC;MACDC,aAAa,EAAE;QACb,GAAGT,WAAW,CAACS;MACjB,CAAC;MACDC,WAAW,EAAE;QACX,GAAGV,WAAW,CAACU;MACjB,CAAC;MACDC,iBAAiB,EAAEX,WAAW,CAACY,oBAAoB;MACnDC,YAAY,EAAE;QAAE,GAAGb,WAAW,CAACa;MAAa;IAC9C,CAAC;IAEDjB,aAAa,CAACkB,SAAS,CAACC,eAAe,CAACb,OAAO,CAAC;EAClD,CAAC;EAED;AACF;AACA;AACA;EACEc,MAAMA,CAACC,QAAkC,EAAE;IACzC,MAAMC,YAAY,GAChBrB,QAAQ,CAACsB,EAAE,KAAK,SAAS,GACrB,IAAIxB,kBAAkB,CAAC,CAAC,GACxB,IAAIA,kBAAkB,CAACC,aAAa,CAACkB,SAAS,CAAC;IACrD,IAAIM,aAAa,GAAGF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,WAAW,CAAC,UAAU,EAAEJ,QAAQ,CAAC;IAEnE,OAAO,MAAM;MACXG,aAAa,CAACE,MAAM,CAAC,CAAC;IACxB,CAAC;EACH;AACF,CAAC"}
@@ -1,2 +1,2 @@
1
- export {};
1
+
2
2
  //# sourceMappingURL=types.d.js.map
@@ -1,4 +1,3 @@
1
1
  export * from './utils';
2
- export declare const QoreIdButton: any;
3
- export declare const QoreIdSdk: any;
2
+ export * from './qoreIdSdk';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AA0BA,cAAc,SAAS,CAAC;AAcxB,eAAO,MAAM,YAAY,KAGJ,CAAC;AAEtB,eAAO,MAAM,SAAS,KAGJ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { OnResult, QoreIdData } from './types';
2
+ export declare const QoreIdSdk: {
3
+ /**
4
+ * lauches QoreID SDK
5
+ * @param initialData - data to launch Qore ID SDK
6
+ * @requires QoreIdSdk native module installed
7
+ */
8
+ launch(initialData: QoreIdData, _callback?: ((data: OnResult) => void) | undefined): void;
9
+ /**
10
+ * QoreIdSdk events listener. It takes callbacks to handle success and error events
11
+ * @param callback(data: OnResultType) Handles various events from QoreID SDK
12
+ */
13
+ events(callback: (data: OnResult) => void): () => void;
14
+ };
15
+ //# sourceMappingURL=qoreIdSdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qoreIdSdk.d.ts","sourceRoot":"","sources":["../../src/qoreIdSdk.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,SAAS;IACpB;;;;OAIG;wBACiB,UAAU,sBAAqB,QAAQ,KAAK,IAAI;IAsBpE;;;OAGG;4BACqB,QAAQ,KAAK,IAAI;CAW1C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qore-id/react-native-qoreid-sdk",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "description": "QoreId React Native SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -14,7 +14,6 @@
14
14
  "ios",
15
15
  "cpp",
16
16
  "*.podspec",
17
- "!src/qoreIdButton.ios.tsx",
18
17
  "!lib/typescript/example",
19
18
  "!ios/build",
20
19
  "!android/build",
@@ -80,8 +79,7 @@
80
79
  },
81
80
  "peerDependencies": {
82
81
  "react": "*",
83
- "react-native": "*",
84
- "react-native-webview": "*"
82
+ "react-native": "*"
85
83
  },
86
84
  "engines": {
87
85
  "node": ">= 16.0.0"
@@ -123,6 +121,7 @@
123
121
  "prettier"
124
122
  ],
125
123
  "rules": {
124
+ "react-native/no-inline-styles": 0,
126
125
  "prettier/prettier": [
127
126
  "error",
128
127
  {
@@ -159,8 +158,5 @@
159
158
  }
160
159
  ]
161
160
  ]
162
- },
163
- "dependencies": {
164
- "react-native-webview": "^12.2.0"
165
161
  }
166
162
  }
@@ -11,13 +11,13 @@ Pod::Spec.new do |s|
11
11
  s.license = package["license"]
12
12
  s.authors = package["author"]
13
13
 
14
- s.platforms = { :ios => "11.0" }
14
+ s.platforms = { :ios => "12.0" }
15
15
  s.source = { :git => "https://.git", :tag => "#{s.version}" }
16
16
 
17
- s.source_files = "ios/**/*.{h,m,mm}"
18
-
17
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
19
18
  s.dependency "React-Core"
20
-
19
+ s.dependency 'QoreIDSDK', '1.0.1'
20
+
21
21
  # Don't install the dependencies when we run `pod install` in the old architecture.
22
22
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
23
23
  s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
package/src/index.tsx CHANGED
@@ -1,49 +1,2 @@
1
- import { Platform, Text, TouchableOpacity } from 'react-native';
2
- import type { IQoreIdButton } from './types';
3
- import React from 'react';
4
-
5
- //Safe fail implementation for iOS
6
- const QoreIdButtonIOS: React.FC<IQoreIdButton> = (initialData) => {
7
- console.info('No implementation for iOS');
8
- return (
9
- (initialData.render && initialData.render({ onPress: () => {} })) || (
10
- <TouchableOpacity
11
- style={{
12
- flex: 1,
13
- justifyContent: 'center',
14
- alignItems: 'center',
15
- paddingHorizontal: 10,
16
- paddingVertical: 5,
17
- }}
18
- >
19
- <Text style={{ color: 'blue' }}>Start QoreID</Text>
20
- </TouchableOpacity>
21
- )
22
- );
23
- };
24
-
25
- // (require('./qoreIdButton.ios').QoreIdButton as React.FC<IQoreIdButton>);
26
-
27
1
  export * from './utils';
28
-
29
- const QoreIdSdkIOS = {
30
- launchQoreId: (_data: unknown) => {
31
- console.info('No implementation for iOS');
32
- },
33
- events: (
34
- _onSuccess: (data: unknown) => void,
35
- _onError: (data: unknown) => void
36
- ) => {
37
- console.info('No implementation for iOS');
38
- },
39
- };
40
-
41
- export const QoreIdButton =
42
- Platform.OS === 'android'
43
- ? require('./qoreIdButton.android').QoreIdButton
44
- : QoreIdButtonIOS;
45
-
46
- export const QoreIdSdk =
47
- Platform.OS === 'android'
48
- ? require('./qoreIdButton.android').QoreIdSdk
49
- : QoreIdSdkIOS;
2
+ export * from './qoreIdSdk';
@@ -0,0 +1,47 @@
1
+ import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
2
+ import type { OnResult, QoreIdData } from './types';
3
+
4
+ export const QoreIdSdk = {
5
+ /**
6
+ * lauches QoreID SDK
7
+ * @param initialData - data to launch Qore ID SDK
8
+ * @requires QoreIdSdk native module installed
9
+ */
10
+ launch(initialData: QoreIdData, _callback?: (data: OnResult) => void) {
11
+ const payload = {
12
+ config: {
13
+ flowId: initialData.flowId || 0,
14
+ customerReference: initialData.customerReference,
15
+ productCode: initialData.productCode,
16
+ clientId: initialData.clientId,
17
+ defaultIdType: initialData?.defaultIdType || '',
18
+ },
19
+ applicantData: {
20
+ ...initialData.applicantData,
21
+ },
22
+ addressData: {
23
+ ...initialData.addressData,
24
+ },
25
+ acceptedDocuments: initialData.ocrAcceptedDocuments,
26
+ identityData: { ...initialData.identityData },
27
+ };
28
+
29
+ NativeModules.QoreidSdk.launchQoreidSdk(payload);
30
+ },
31
+
32
+ /**
33
+ * QoreIdSdk events listener. It takes callbacks to handle success and error events
34
+ * @param callback(data: OnResultType) Handles various events from QoreID SDK
35
+ */
36
+ events(callback: (data: OnResult) => void) {
37
+ const eventEmitter =
38
+ Platform.OS === 'android'
39
+ ? new NativeEventEmitter()
40
+ : new NativeEventEmitter(NativeModules.QoreidSdk);
41
+ let eventListener = eventEmitter?.addListener('onResult', callback);
42
+
43
+ return () => {
44
+ eventListener.remove();
45
+ };
46
+ },
47
+ };
package/src/types.d.ts CHANGED
@@ -1,11 +1,13 @@
1
- import type { GestureResponderEvent } from 'react-native';
2
-
3
- export interface DataType {
4
- config: IConfig;
1
+ export interface QoreIdData {
2
+ flowId?: number;
3
+ customerReference: string;
4
+ productCode: string;
5
+ clientId: string;
6
+ defaultIdType?: string;
5
7
  applicantData?: ApplicantData;
6
8
  addressData?: AddressData;
7
- acceptedDocuments?: string | string[];
8
- identityData?: IdentityData
9
+ ocrAcceptedDocuments: string[];
10
+ identityData?: IdentityData;
9
11
  }
10
12
 
11
13
  interface IConfig {
@@ -41,59 +43,13 @@ interface AddressData {
41
43
  virAddress?: string;
42
44
  }
43
45
 
44
- export interface OnResultType {
46
+ export interface OnResult {
45
47
  code: string;
46
48
  data: string;
47
49
  message: string;
48
50
  }
49
51
 
50
- export interface Options {
51
- config: string;
52
- onSubmitted?: (data: Omit<OnResultType, 'code'>) => void;
53
- onError?: (data: OnResultType) => void;
54
- buttonProps?: {
55
- title?: string;
56
- color?: string;
57
- backgroundColor?: string;
58
- };
59
- }
60
-
61
-
62
-
63
- export interface BrowserEventData {
64
- type: string;
65
- detail: any;
66
- }
67
-
68
- declare interface IQoreIdButton <T = JSX.Element>{
69
- title?: string
70
- sdkSource?: string
71
- flowId?: number
72
- clientId: string
73
- productCode?: string
74
- customerReference: string
75
- applicantData?: {
76
- firstName: string,
77
- middleName?: string,
78
- lastName: string,
79
- gender: 'male'|'female'|'others' | string,
80
- phoneNumber?: string,
81
- email?: string,
82
- },
83
- identityData?: {
84
- idType: string,
85
- idNumber: string,
86
- },
87
- addressData?: {
88
- address: string,
89
- city: string,
90
- lga: string,
91
- },
92
- ocrAcceptedDocuments?: string,
93
- onQoreIDSdkSubmitted: (data: BrowserEventData | Omit<OnResultType, 'code'>) => void;
94
- onQoreIDSdkError: (data: BrowserEventData | OnResultType) => void;
95
- onQoreIDSdkClosed: (data: BrowserEventData) => void;
96
- /** Render custom button or a Pressable Component */
97
- render?: ({onPress}:{onPress:(event: GestureResponderEvent) => void}) => T.onPress extends {onPress: (event: GestureResponderEvent) => void} ? T : never;
98
- }
99
-
52
+ export type QoreIdSdk = {
53
+ launchQoreId: (initialData: DataTyp) => void;
54
+ events: (OnResult: (data: OnResultType) => void) => void;
55
+ };
package/android/Untitled DELETED
Binary file
package/ios/QoreidSdk.h DELETED
@@ -1,12 +0,0 @@
1
-
2
- #ifdef RCT_NEW_ARCH_ENABLED
3
- #import "RNQoreidSdkSpec.h"
4
-
5
- @interface QoreidSdk : NSObject <NativeQoreidSdkSpec>
6
- #else
7
- #import <React/RCTBridgeModule.h>
8
-
9
- @interface QoreidSdk : NSObject <RCTBridgeModule>
10
- #endif
11
-
12
- @end
package/ios/QoreidSdk.mm DELETED
@@ -1,27 +0,0 @@
1
- #import "QoreidSdk.h"
2
-
3
- @implementation QoreidSdk
4
- RCT_EXPORT_MODULE()
5
-
6
- // Example method
7
- // See // https://reactnative.dev/docs/native-modules-ios
8
- RCT_REMAP_METHOD(multiply,
9
- multiplyWithA:(double)a withB:(double)b
10
- withResolver:(RCTPromiseResolveBlock)resolve
11
- withRejecter:(RCTPromiseRejectBlock)reject)
12
- {
13
- NSNumber *result = @(a * b);
14
-
15
- resolve(result);
16
- }
17
-
18
- // Don't compile this code when we build for the old architecture.
19
- #ifdef RCT_NEW_ARCH_ENABLED
20
- - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
21
- (const facebook::react::ObjCTurboModule::InitParams &)params
22
- {
23
- return std::make_shared<facebook::react::NativeQoreidSdkSpecJSI>(params);
24
- }
25
- #endif
26
-
27
- @end