idwise-nfc-react-native-sdk 0.0.1-alpha1

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 (125) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +48 -0
  3. package/android/build.gradle +117 -0
  4. package/android/gradle.properties +7 -0
  5. package/android/src/main/AndroidManifest.xml +3 -0
  6. package/android/src/main/AndroidManifestNew.xml +2 -0
  7. package/android/src/main/java/com/idwisemobilesdk/IdwiseMobileSdkModule.kt +236 -0
  8. package/android/src/main/java/com/idwisemobilesdk/IdwiseMobileSdkPackage.kt +17 -0
  9. package/idwise-react-native-sdk.podspec +65 -0
  10. package/ios/IDWiseNFC.framework/Assets.car +0 -0
  11. package/ios/IDWiseNFC.framework/BulletCell.nib +0 -0
  12. package/ios/IDWiseNFC.framework/BulletCellRTL.nib +0 -0
  13. package/ios/IDWiseNFC.framework/DocumentCategorySelectionViewController.storyboardc/DocumentCategorySelectionViewController.nib/objects-13.0+.nib +0 -0
  14. package/ios/IDWiseNFC.framework/DocumentCategorySelectionViewController.storyboardc/DocumentCategorySelectionViewController.nib/runtime.nib +0 -0
  15. package/ios/IDWiseNFC.framework/DocumentCategorySelectionViewController.storyboardc/Info.plist +0 -0
  16. package/ios/IDWiseNFC.framework/DocumentCategorySelectionViewController.storyboardc/Y6W-OH-hqX-view-5EZ-qb-Rvc.nib/objects-13.0+.nib +0 -0
  17. package/ios/IDWiseNFC.framework/DocumentCategorySelectionViewController.storyboardc/Y6W-OH-hqX-view-5EZ-qb-Rvc.nib/runtime.nib +0 -0
  18. package/ios/IDWiseNFC.framework/DocumentTypeTableViewCell.nib +0 -0
  19. package/ios/IDWiseNFC.framework/DocumentViewController.storyboardc/HuT-DA-csJ-view-fPz-Uk-RnY.nib/objects-13.0+.nib +0 -0
  20. package/ios/IDWiseNFC.framework/DocumentViewController.storyboardc/HuT-DA-csJ-view-fPz-Uk-RnY.nib/runtime.nib +0 -0
  21. package/ios/IDWiseNFC.framework/DocumentViewController.storyboardc/Info.plist +0 -0
  22. package/ios/IDWiseNFC.framework/DocumentViewController.storyboardc/UIViewController-HuT-DA-csJ.nib/objects-13.0+.nib +0 -0
  23. package/ios/IDWiseNFC.framework/DocumentViewController.storyboardc/UIViewController-HuT-DA-csJ.nib/runtime.nib +0 -0
  24. package/ios/IDWiseNFC.framework/ErrorFeedbackViewController.storyboardc/ErrorFeedbackViewController.nib/objects-13.0+.nib +0 -0
  25. package/ios/IDWiseNFC.framework/ErrorFeedbackViewController.storyboardc/ErrorFeedbackViewController.nib/runtime.nib +0 -0
  26. package/ios/IDWiseNFC.framework/ErrorFeedbackViewController.storyboardc/Info.plist +0 -0
  27. package/ios/IDWiseNFC.framework/ErrorFeedbackViewController.storyboardc/eni-V6-pg3-view-IG7-Dw-aVZ.nib/objects-13.0+.nib +0 -0
  28. package/ios/IDWiseNFC.framework/ErrorFeedbackViewController.storyboardc/eni-V6-pg3-view-IG7-Dw-aVZ.nib/runtime.nib +0 -0
  29. package/ios/IDWiseNFC.framework/FinishJourneyViewContoller.storyboardc/Info.plist +0 -0
  30. package/ios/IDWiseNFC.framework/FinishJourneyViewContoller.storyboardc/UIViewController-Y6W-OH-hqX.nib/objects-13.0+.nib +0 -0
  31. package/ios/IDWiseNFC.framework/FinishJourneyViewContoller.storyboardc/UIViewController-Y6W-OH-hqX.nib/runtime.nib +0 -0
  32. package/ios/IDWiseNFC.framework/FinishJourneyViewContoller.storyboardc/Y6W-OH-hqX-view-5EZ-qb-Rvc.nib/objects-13.0+.nib +0 -0
  33. package/ios/IDWiseNFC.framework/FinishJourneyViewContoller.storyboardc/Y6W-OH-hqX-view-5EZ-qb-Rvc.nib/runtime.nib +0 -0
  34. package/ios/IDWiseNFC.framework/Headers/IDWise.h +18 -0
  35. package/ios/IDWiseNFC.framework/IDWiseNFC +0 -0
  36. package/ios/IDWiseNFC.framework/Info.plist +0 -0
  37. package/ios/IDWiseNFC.framework/JourneyIntroductionViewController.storyboardc/A5G-4b-J84-view-Avi-oP-H2l.nib/objects-13.0+.nib +0 -0
  38. package/ios/IDWiseNFC.framework/JourneyIntroductionViewController.storyboardc/A5G-4b-J84-view-Avi-oP-H2l.nib/runtime.nib +0 -0
  39. package/ios/IDWiseNFC.framework/JourneyIntroductionViewController.storyboardc/Info.plist +0 -0
  40. package/ios/IDWiseNFC.framework/JourneyIntroductionViewController.storyboardc/UIViewController-A5G-4b-J84.nib/objects-13.0+.nib +0 -0
  41. package/ios/IDWiseNFC.framework/JourneyIntroductionViewController.storyboardc/UIViewController-A5G-4b-J84.nib/runtime.nib +0 -0
  42. package/ios/IDWiseNFC.framework/MenuCell.nib +0 -0
  43. package/ios/IDWiseNFC.framework/MenuWidgetView.nib +0 -0
  44. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  45. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  46. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/arm64-apple-ios.abi.json +46777 -0
  47. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/arm64-apple-ios.private.swiftinterface +539 -0
  48. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  49. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/arm64-apple-ios.swiftinterface +539 -0
  50. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
  51. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/x86_64-apple-ios-simulator.abi.json +46770 -0
  52. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +539 -0
  53. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  54. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +539 -0
  55. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule +0 -0
  56. package/ios/IDWiseNFC.framework/Mulish-Bold.ttf +0 -0
  57. package/ios/IDWiseNFC.framework/Mulish-Light.ttf +0 -0
  58. package/ios/IDWiseNFC.framework/Mulish-Regular.ttf +0 -0
  59. package/ios/IDWiseNFC.framework/ProcessJourneyViewController.storyboardc/Info.plist +0 -0
  60. package/ios/IDWiseNFC.framework/ProcessJourneyViewController.storyboardc/ProcessJourneyViewController.nib/objects-13.0+.nib +0 -0
  61. package/ios/IDWiseNFC.framework/ProcessJourneyViewController.storyboardc/ProcessJourneyViewController.nib/runtime.nib +0 -0
  62. package/ios/IDWiseNFC.framework/ProcessJourneyViewController.storyboardc/yS7-79-T86-view-owr-v5-NaP.nib/objects-13.0+.nib +0 -0
  63. package/ios/IDWiseNFC.framework/ProcessJourneyViewController.storyboardc/yS7-79-T86-view-owr-v5-NaP.nib/runtime.nib +0 -0
  64. package/ios/IDWiseNFC.framework/ProgressBarMenuScreen.nib/objects-13.0+.nib +0 -0
  65. package/ios/IDWiseNFC.framework/ProgressBarMenuScreen.nib/runtime.nib +0 -0
  66. package/ios/IDWiseNFC.framework/ProgressBarView.nib/objects-13.0+.nib +0 -0
  67. package/ios/IDWiseNFC.framework/ProgressBarView.nib/runtime.nib +0 -0
  68. package/ios/IDWiseNFC.framework/RegulaSDKController.storyboardc/Info.plist +0 -0
  69. package/ios/IDWiseNFC.framework/RegulaSDKController.storyboardc/RegulaSDKController.nib +0 -0
  70. package/ios/IDWiseNFC.framework/RegulaSDKController.storyboardc/Y6W-OH-hqX-view-5EZ-qb-Rvc.nib +0 -0
  71. package/ios/IDWiseNFC.framework/SelfieViewController.storyboardc/Info.plist +0 -0
  72. package/ios/IDWiseNFC.framework/SelfieViewController.storyboardc/Od6-6k-VCn-view-avu-y3-b61.nib +0 -0
  73. package/ios/IDWiseNFC.framework/SelfieViewController.storyboardc/UIViewController-Od6-6k-VCn.nib +0 -0
  74. package/ios/IDWiseNFC.framework/StartJourneyViewController.storyboardc/Info.plist +0 -0
  75. package/ios/IDWiseNFC.framework/StartJourneyViewController.storyboardc/StartJourneyViewController.nib/objects-13.0+.nib +0 -0
  76. package/ios/IDWiseNFC.framework/StartJourneyViewController.storyboardc/StartJourneyViewController.nib/runtime.nib +0 -0
  77. package/ios/IDWiseNFC.framework/StartJourneyViewController.storyboardc/eni-V6-pg3-view-IG7-Dw-aVZ.nib/objects-13.0+.nib +0 -0
  78. package/ios/IDWiseNFC.framework/StartJourneyViewController.storyboardc/eni-V6-pg3-view-IG7-Dw-aVZ.nib/runtime.nib +0 -0
  79. package/ios/IDWiseNFC.framework/StepCell.nib +0 -0
  80. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/analytics/coremldata.bin +0 -0
  81. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/coremldata.bin +0 -0
  82. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/metadata.json +115 -0
  83. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/analytics/coremldata.bin +0 -0
  84. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/coremldata.bin +0 -0
  85. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/model/coremldata.bin +0 -0
  86. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/model.espresso.net +4737 -0
  87. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/model.espresso.shape +1789 -0
  88. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/model.espresso.weights +0 -0
  89. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/neural_network_optionals/coremldata.bin +0 -0
  90. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model1/coremldata.bin +0 -0
  91. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/analytics/coremldata.bin +0 -0
  92. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/coremldata.bin +0 -0
  93. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/metadata.json +79 -0
  94. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/model/coremldata.bin +0 -0
  95. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/model.espresso.net +2250 -0
  96. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/model.espresso.shape +718 -0
  97. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/model.espresso.weights +0 -0
  98. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/neural_network_optionals/coremldata.bin +0 -0
  99. package/ios/IDWiseNFC.framework/en.lproj/Localizable.strings +0 -0
  100. package/ios/IDWiseNFC.framework/journey_image_config.json +96 -0
  101. package/ios/IDWiseNFC.framework/regula.license +0 -0
  102. package/ios/IdwiseMobileSdk-Bridging-Header.h +2 -0
  103. package/ios/IdwiseMobileSdk.mm +37 -0
  104. package/ios/IdwiseMobileSdk.swift +269 -0
  105. package/lib/commonjs/IDWise.js +74 -0
  106. package/lib/commonjs/IDWise.js.map +1 -0
  107. package/lib/commonjs/IDWiseConstants.js +26 -0
  108. package/lib/commonjs/IDWiseConstants.js.map +1 -0
  109. package/lib/commonjs/IDWiseEventListeners.js +79 -0
  110. package/lib/commonjs/IDWiseEventListeners.js.map +1 -0
  111. package/lib/commonjs/index.js +15 -0
  112. package/lib/commonjs/index.js.map +1 -0
  113. package/lib/module/IDWise.js +68 -0
  114. package/lib/module/IDWise.js.map +1 -0
  115. package/lib/module/IDWiseConstants.js +20 -0
  116. package/lib/module/IDWiseConstants.js.map +1 -0
  117. package/lib/module/IDWiseEventListeners.js +70 -0
  118. package/lib/module/IDWiseEventListeners.js.map +1 -0
  119. package/lib/module/index.js +7 -0
  120. package/lib/module/index.js.map +1 -0
  121. package/package.json +164 -0
  122. package/src/IDWise.js +123 -0
  123. package/src/IDWiseConstants.js +23 -0
  124. package/src/IDWiseEventListeners.js +105 -0
  125. package/src/index.js +4 -0
@@ -0,0 +1,68 @@
1
+ import { NativeModules, Platform } from 'react-native';
2
+ import { setInitializeEventListeners, setJourneyEventListeners, setJourneySummaryEventListener, setStepEventListeners } from './IDWiseEventListeners';
3
+ const LINKING_ERROR = `The package 'idwise-mobile-sdk' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
4
+ ios: "- You have run 'pod install'\n",
5
+ default: ''
6
+ }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
7
+ const RNIDWise = NativeModules.IdwiseMobileSdk ? NativeModules.IdwiseMobileSdk : new Proxy({}, {
8
+ get() {
9
+ throw new Error(LINKING_ERROR);
10
+ }
11
+ });
12
+ const initialize = (clientKey, theme, callback) => {
13
+ console.log('IDWise - initialize');
14
+ setInitializeEventListeners(callback);
15
+ RNIDWise.initialize(clientKey, theme);
16
+ };
17
+ const startJourney = (journeyDefinitionId, referenceNo, locale, journeyCallback) => {
18
+ console.log('IDWise - startJourney');
19
+ setJourneyEventListeners(journeyCallback);
20
+ setStepEventListeners(null);
21
+ RNIDWise.startJourney(journeyDefinitionId, referenceNo, locale);
22
+ };
23
+ const startDynamicJourney = (journeyDefinitionId, referenceNo, locale, journeyCallback, stepCallback) => {
24
+ console.log('IDWise - startDynamicJourney');
25
+ setJourneyEventListeners(journeyCallback);
26
+ setStepEventListeners(stepCallback);
27
+ RNIDWise.startDynamicJourney(journeyDefinitionId, referenceNo, locale);
28
+ };
29
+ const resumeDynamicJourney = (journeyDefinitionId, journeyId, locale, journeyCallback, stepCallback) => {
30
+ console.log('IDWise - resumeDynamicJourney');
31
+ setJourneyEventListeners(journeyCallback);
32
+ setStepEventListeners(stepCallback);
33
+ RNIDWise.resumeDynamicJourney(journeyDefinitionId, journeyId, locale);
34
+ };
35
+ const resumeJourney = (journeyDefinitionId, journeyId, locale, journeyCallback) => {
36
+ console.log('IDWise - resumeJourney');
37
+ setJourneyEventListeners(journeyCallback);
38
+ RNIDWise.resumeJourney(journeyDefinitionId, journeyId, locale);
39
+ };
40
+ const startStep = stepId => RNIDWise.startStep(stepId);
41
+ const skipStep = stepId => RNIDWise.skipStep(stepId);
42
+ const getJourneySummary = callback => {
43
+ console.log('IDWise - getJourneySummary');
44
+ setJourneySummaryEventListener(callback);
45
+ RNIDWise.getJourneySummary();
46
+ };
47
+ const finishDynamicJourney = () => {
48
+ console.log('IDWise - finishDynamicJourney');
49
+ RNIDWise.finishDynamicJourney();
50
+ };
51
+ const unloadSDK = () => {
52
+ console.log('IDWise - unloadSDK');
53
+ RNIDWise.unloadSDK();
54
+ };
55
+ export const IDWise = {
56
+ initialize,
57
+ startJourney,
58
+ startDynamicJourney,
59
+ resumeDynamicJourney,
60
+ startStep,
61
+ getJourneySummary,
62
+ finishDynamicJourney,
63
+ skipStep,
64
+ //TODO: uncomment below once it is implemented on iOS
65
+ //resumeJourney,
66
+ unloadSDK
67
+ };
68
+ //# sourceMappingURL=IDWise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModules","Platform","setInitializeEventListeners","setJourneyEventListeners","setJourneySummaryEventListener","setStepEventListeners","LINKING_ERROR","select","ios","default","RNIDWise","IdwiseMobileSdk","Proxy","get","Error","initialize","clientKey","theme","callback","console","log","startJourney","journeyDefinitionId","referenceNo","locale","journeyCallback","startDynamicJourney","stepCallback","resumeDynamicJourney","journeyId","resumeJourney","startStep","stepId","skipStep","getJourneySummary","finishDynamicJourney","unloadSDK","IDWise"],"sourceRoot":"../../src","sources":["IDWise.js"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,SACEC,2BAA2B,EAC3BC,wBAAwB,EACxBC,8BAA8B,EAC9BC,qBAAqB,QAChB,wBAAwB;AAE/B,MAAMC,aAAa,GAChB,4EAA2E,GAC5EL,QAAQ,CAACM,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG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 EVENT_INITIALIZE_ERRROR: 'onInitializeError',
3
+ EVENT_JOURNEY_STARTED: 'onJourneyStarted',
4
+ EVENT_JOURNEY_RESUMED: 'onJourneyResumed',
5
+ EVENT_JOURNEY_FINISHED: 'onJourneyFinished',
6
+ EVENT_JOURNEY_CANCELLED: 'onJourneyCancelled',
7
+ EVENT_JOURNEY_ERROR: 'onJourneyError',
8
+ EVENT_JOURNEY_SUMMARY: 'onJourneySummary',
9
+ EVENT_JOURNEY_SUMMARY_ERROR: 'onJourneySummaryError',
10
+ EVENT_STEP_CAPTURED: 'onStepCaptured',
11
+ EVENT_STEP_RESULT: 'onStepResult',
12
+ EVENT_STEP_CANCELLED: 'onStepCancelled',
13
+ EVENT_STEP_SKIPPED: 'onStepSkipped'
14
+ };
15
+ export const IDWiseSDKTheme = {
16
+ LIGHT: 'LIGHT',
17
+ DARK: 'DARK',
18
+ SYSTEM_DEFAULT: 'SYSTEM_DEFAULT'
19
+ };
20
+ //# sourceMappingURL=IDWiseConstants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["IDWiseEvents","EVENT_INITIALIZE_ERRROR","EVENT_JOURNEY_STARTED","EVENT_JOURNEY_RESUMED","EVENT_JOURNEY_FINISHED","EVENT_JOURNEY_CANCELLED","EVENT_JOURNEY_ERROR","EVENT_JOURNEY_SUMMARY","EVENT_JOURNEY_SUMMARY_ERROR","EVENT_STEP_CAPTURED","EVENT_STEP_RESULT","EVENT_STEP_CANCELLED","EVENT_STEP_SKIPPED","IDWiseSDKTheme","LIGHT","DARK","SYSTEM_DEFAULT"],"sourceRoot":"../../src","sources":["IDWiseConstants.js"],"mappings":"AAAA,OAAO,MAAMA,YAAY,GAAG;EAC1BC,uBAAuB,EAAE,mBAAmB;EAE5CC,qBAAqB,EAAE,kBAAkB;EACzCC,qBAAqB,EAAE,kBAAkB;EACzCC,sBAAsB,EAAE,mBAAmB;EAC3CC,uBAAuB,EAAE,oBAAoB;EAC7CC,mBAAmB,EAAE,gBAAgB;EAErCC,qBAAqB,EAAE,kBAAkB;EACzCC,2BAA2B,EAAE,uBAAuB;EAEpDC,mBAAmB,EAAE,gBAAgB;EACrCC,iBAAiB,EAAE,cAAc;EACjCC,oBAAoB,EAAE,iBAAiB;EACvCC,kBAAkB,EAAE;AACtB,CAAC;AAED,OAAO,MAAMC,cAAc,GAAG;EAC5BC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,cAAc,EAAE;AAClB,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { NativeEventEmitter, NativeModules } from 'react-native';
2
+ import { IDWiseEvents } from './IDWiseConstants';
3
+ const RNIDWise = NativeModules.IdwiseMobileSdk ? NativeModules.IdwiseMobileSdk : new Proxy({}, {
4
+ get() {
5
+ throw new Error(LINKING_ERROR);
6
+ }
7
+ });
8
+ const eventEmitter = new NativeEventEmitter(RNIDWise);
9
+ const setInitializeEventListeners = idwiseInitializeCallback => {
10
+ console.log('IDWise - setInitializeEventListeners');
11
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_INITIALIZE_ERRROR);
12
+ eventEmitter.addListener(IDWiseEvents.EVENT_INITIALIZE_ERRROR, event => {
13
+ idwiseInitializeCallback === null || idwiseInitializeCallback === void 0 || idwiseInitializeCallback.onError(event);
14
+ });
15
+ };
16
+ const setJourneyEventListeners = idwiseJourneyCallback => {
17
+ console.log('IDWise - setJourneyEventListeners');
18
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_JOURNEY_STARTED);
19
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_JOURNEY_RESUMED);
20
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_JOURNEY_FINISHED);
21
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_JOURNEY_CANCELLED);
22
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_JOURNEY_ERROR);
23
+ eventEmitter.addListener(IDWiseEvents.EVENT_JOURNEY_STARTED, event => {
24
+ idwiseJourneyCallback === null || idwiseJourneyCallback === void 0 || idwiseJourneyCallback.onJourneyStarted(event);
25
+ });
26
+ eventEmitter.addListener(IDWiseEvents.EVENT_JOURNEY_RESUMED, event => {
27
+ idwiseJourneyCallback === null || idwiseJourneyCallback === void 0 || idwiseJourneyCallback.onJourneyResumed(event);
28
+ });
29
+ eventEmitter.addListener(IDWiseEvents.EVENT_JOURNEY_FINISHED, event => {
30
+ idwiseJourneyCallback === null || idwiseJourneyCallback === void 0 || idwiseJourneyCallback.onJourneyFinished(event);
31
+ });
32
+ eventEmitter.addListener(IDWiseEvents.EVENT_JOURNEY_CANCELLED, event => {
33
+ idwiseJourneyCallback === null || idwiseJourneyCallback === void 0 || idwiseJourneyCallback.onJourneyCancelled(event);
34
+ });
35
+ eventEmitter.addListener(IDWiseEvents.EVENT_JOURNEY_ERROR, event => {
36
+ idwiseJourneyCallback === null || idwiseJourneyCallback === void 0 || idwiseJourneyCallback.onError(event);
37
+ });
38
+ };
39
+ const setStepEventListeners = idwiseStepCallback => {
40
+ console.log('IDWise - setStepEventListener');
41
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_STEP_CAPTURED);
42
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_STEP_RESULT);
43
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_STEP_CANCELLED);
44
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_STEP_SKIPPED);
45
+ eventEmitter.addListener(IDWiseEvents.EVENT_STEP_CAPTURED, event => {
46
+ idwiseStepCallback === null || idwiseStepCallback === void 0 || idwiseStepCallback.onStepCaptured(event.stepId, event.capturedImage);
47
+ });
48
+ eventEmitter.addListener(IDWiseEvents.EVENT_STEP_RESULT, event => {
49
+ idwiseStepCallback === null || idwiseStepCallback === void 0 || idwiseStepCallback.onStepResult(event.stepId, JSON.parse(event.stepResult));
50
+ });
51
+ eventEmitter.addListener(IDWiseEvents.EVENT_STEP_CANCELLED, event => {
52
+ idwiseStepCallback === null || idwiseStepCallback === void 0 || idwiseStepCallback.onStepCancelled(event);
53
+ });
54
+ eventEmitter.addListener(IDWiseEvents.EVENT_STEP_SKIPPED, event => {
55
+ idwiseStepCallback === null || idwiseStepCallback === void 0 || idwiseStepCallback.onStepSkipped(event);
56
+ });
57
+ };
58
+ const setJourneySummaryEventListener = idwiseJourneySummaryCallback => {
59
+ console.log('IDWise - setJourneySummaryEventListener');
60
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_JOURNEY_SUMMARY);
61
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_JOURNEY_SUMMARY_ERROR);
62
+ eventEmitter.addListener(IDWiseEvents.EVENT_JOURNEY_SUMMARY, event => {
63
+ idwiseJourneySummaryCallback === null || idwiseJourneySummaryCallback === void 0 || idwiseJourneySummaryCallback.onJourneySummary(JSON.parse(event.summary));
64
+ });
65
+ eventEmitter.addListener(IDWiseEvents.EVENT_JOURNEY_SUMMARY_ERROR, event => {
66
+ idwiseJourneySummaryCallback === null || idwiseJourneySummaryCallback === void 0 || idwiseJourneySummaryCallback.onError(JSON.parse(event.error));
67
+ });
68
+ };
69
+ export { setInitializeEventListeners, setJourneyEventListeners, setJourneySummaryEventListener, setStepEventListeners };
70
+ //# sourceMappingURL=IDWiseEventListeners.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","IDWiseEvents","RNIDWise","IdwiseMobileSdk","Proxy","get","Error","LINKING_ERROR","eventEmitter","setInitializeEventListeners","idwiseInitializeCallback","console","log","removeAllListeners","EVENT_INITIALIZE_ERRROR","addListener","event","onError","setJourneyEventListeners","idwiseJourneyCallback","EVENT_JOURNEY_STARTED","EVENT_JOURNEY_RESUMED","EVENT_JOURNEY_FINISHED","EVENT_JOURNEY_CANCELLED","EVENT_JOURNEY_ERROR","onJourneyStarted","onJourneyResumed","onJourneyFinished","onJourneyCancelled","setStepEventListeners","idwiseStepCallback","EVENT_STEP_CAPTURED","EVENT_STEP_RESULT","EVENT_STEP_CANCELLED","EVENT_STEP_SKIPPED","onStepCaptured","stepId","capturedImage","onStepResult","JSON","parse","stepResult","onStepCancelled","onStepSkipped","setJourneySummaryEventListener","idwiseJourneySummaryCallback","EVENT_JOURNEY_SUMMARY","EVENT_JOURNEY_SUMMARY_ERROR","onJourneySummary","summary","error"],"sourceRoot":"../../src","sources":["IDWiseEventListeners.js"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAChE,SAASC,YAAY,QAAQ,mBAAmB;AAEhD,MAAMC,QAAQ,GAAGF,aAAa,CAACG,eAAe,GAC1CH,aAAa,CAACG,eAAe,GAC7B,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACC,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,MAAMC,YAAY,GAAG,IAAIT,kBAAkB,CAACG,QAAQ,CAAC;AAErD,MAAMO,2BAA2B,GAAIC,wBAAwB,IAAK;EAChEC,OAAO,CAACC,GAAG,CAAC,sCAAsC,CAAC;EACnDJ,YAAY,CAACK,kBAAkB,CAACZ,YAAY,CAACa,uBAAuB,CAAC;EAErEN,YAAY,CAACO,WAAW,CAACd,YAAY,CAACa,uBAAuB,EAAGE,KAAK,IAAK;IACxEN,wBAAwB,aAAxBA,wBAAwB,eAAxBA,wBAAwB,CAAEO,OAAO,CAACD,KAAK,CAAC;EAC1C,CAAC,CAAC;AACJ,CAAC;AAED,MAAME,wBAAwB,GAAIC,qBAAqB,IAAK;EAC1DR,OAAO,CAACC,GAAG,CAAC,mCAAmC,CAAC;EAChDJ,YAAY,CAACK,kBAAkB,CAACZ,YAAY,CAACmB,qBAAqB,CAAC;EACnEZ,YAAY,CAACK,kBAAkB,CAACZ,YAAY,CAACoB,qBAAqB,CAAC;EACnEb,YAAY,CAACK,kBAAkB,CAACZ,YAAY,CAACqB,sBAAsB,CAAC;EACpEd,YAAY,CAACK,kBAAkB,CAACZ,YAAY,CAACsB,uBAAuB,CA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EG,gBAAgB,CAACT,IAAI,CAACC,KAAK,CAACxB,KAAK,CAACiC,OAAO,CAAC,CAAC;EAC3E,CAAC,CAAC;EAEFzC,YAAY,CAACO,WAAW,CACtBd,YAAY,CAAC8C,2BAA2B,EACvC/B,KAAK,IAAK;IACT6B,4BAA4B,aAA5BA,4BAA4B,eAA5BA,4BAA4B,CAAE5B,OAAO,CAACsB,IAAI,CAACC,KAAK,CAACxB,KAAK,CAACkC,KAAK,CAAC,CAAC;EAChE,CACF,CAAC;AACH,CAAC;AAED,SACEzC,2BAA2B,EAC3BS,wBAAwB,EACxB0B,8BAA8B,EAC9Bf,qBAAqB"}
@@ -0,0 +1,7 @@
1
+ import * as IDWise from './IDWise';
2
+ import { IDWiseSDKTheme } from './IDWiseConstants';
3
+ export default {
4
+ IDWise,
5
+ IDWiseSDKTheme
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["IDWise","IDWiseSDKTheme"],"sourceRoot":"../../src","sources":["index.js"],"mappings":"AAAA,OAAO,KAAKA,MAAM,MAAM,UAAU;AAClC,SAASC,cAAc,QAAQ,mBAAmB;AAElD,eAAe;EAAED,MAAM;EAAEC;AAAe,CAAC"}
package/package.json ADDED
@@ -0,0 +1,164 @@
1
+ {
2
+ "name": "idwise-nfc-react-native-sdk",
3
+ "version": "0.0.1-alpha1",
4
+ "description": "IDWise React Native SDK with NFC",
5
+ "main": "lib/commonjs/index",
6
+ "module": "lib/module/index",
7
+ "types": "lib/typescript/src/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
+ "!ios/build",
18
+ "!android/build",
19
+ "!android/gradle",
20
+ "!android/gradlew",
21
+ "!android/gradlew.bat",
22
+ "!android/local.properties",
23
+ "!**/key.properties",
24
+ "!**/local.properties",
25
+ "!commit.txt",
26
+ "!ios_version.txt",
27
+ "!**/*.sh",
28
+ "!**/__tests__",
29
+ "!**/__fixtures__",
30
+ "!**/__mocks__",
31
+ "!**/.*"
32
+ ],
33
+ "scripts": {
34
+ "example": "yarn workspace idwise-react-native-sdk-example",
35
+ "test": "jest",
36
+ "typecheck": "tsc --noEmit",
37
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
38
+ "prepare": "bob build",
39
+ "release": "release-it"
40
+ },
41
+ "keywords": [
42
+ "react-native",
43
+ "ios",
44
+ "android"
45
+ ],
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "https://github.com/idwise/idwise-mobile-sdk-react-native"
49
+ },
50
+ "author": "idwise <info@idwise.com> (https://github.com/idwise)",
51
+ "license": "MIT",
52
+ "bugs": {
53
+ "url": "https://github.com/idwise/idwise-mobile-sdk-react-native/issues"
54
+ },
55
+ "homepage": "https://github.com/idwise/idwise-mobile-sdk-react-native#readme",
56
+ "publishConfig": {
57
+ "registry": "https://registry.npmjs.org/"
58
+ },
59
+ "devDependencies": {
60
+ "@commitlint/config-conventional": "^17.0.2",
61
+ "@evilmartians/lefthook": "^1.5.0",
62
+ "@react-native/eslint-config": "^0.72.2",
63
+ "@release-it/conventional-changelog": "^5.0.0",
64
+ "@types/jest": "^28.1.2",
65
+ "@types/react": "~17.0.21",
66
+ "@types/react-native": "0.70.0",
67
+ "commitlint": "^17.0.2",
68
+ "del-cli": "^5.0.0",
69
+ "eslint": "^8.4.1",
70
+ "eslint-config-prettier": "^8.5.0",
71
+ "eslint-plugin-prettier": "^4.0.0",
72
+ "jest": "^28.1.1",
73
+ "pod-install": "^0.1.0",
74
+ "prettier": "^2.0.5",
75
+ "react": "18.2.0",
76
+ "react-native": "0.72.6",
77
+ "react-native-builder-bob": "^0.20.0",
78
+ "release-it": "^15.0.0",
79
+ "turbo": "^1.10.7",
80
+ "typescript": "^5.0.2"
81
+ },
82
+ "resolutions": {
83
+ "@types/react": "17.0.21"
84
+ },
85
+ "peerDependencies": {
86
+ "react": "*",
87
+ "react-native": "*"
88
+ },
89
+ "workspaces": [
90
+ "example"
91
+ ],
92
+ "packageManager": "yarn@3.6.1",
93
+ "engines": {
94
+ "node": ">= 18.0.0"
95
+ },
96
+ "jest": {
97
+ "preset": "react-native",
98
+ "modulePathIgnorePatterns": [
99
+ "<rootDir>/example/node_modules",
100
+ "<rootDir>/lib/"
101
+ ]
102
+ },
103
+ "release-it": {
104
+ "git": {
105
+ "commitMessage": "chore: release ${version}",
106
+ "tagName": "v${version}"
107
+ },
108
+ "npm": {
109
+ "publish": true
110
+ },
111
+ "github": {
112
+ "release": true
113
+ },
114
+ "plugins": {
115
+ "@release-it/conventional-changelog": {
116
+ "preset": "angular"
117
+ }
118
+ }
119
+ },
120
+ "eslintConfig": {
121
+ "root": true,
122
+ "extends": [
123
+ "@react-native",
124
+ "prettier"
125
+ ],
126
+ "rules": {
127
+ "prettier/prettier": [
128
+ "error",
129
+ {
130
+ "quoteProps": "consistent",
131
+ "singleQuote": true,
132
+ "tabWidth": 2,
133
+ "trailingComma": "es5",
134
+ "useTabs": false
135
+ }
136
+ ]
137
+ }
138
+ },
139
+ "eslintIgnore": [
140
+ "node_modules/",
141
+ "lib/"
142
+ ],
143
+ "prettier": {
144
+ "quoteProps": "consistent",
145
+ "singleQuote": true,
146
+ "tabWidth": 2,
147
+ "trailingComma": "es5",
148
+ "useTabs": false
149
+ },
150
+ "react-native-builder-bob": {
151
+ "source": "src",
152
+ "output": "lib",
153
+ "targets": [
154
+ "commonjs",
155
+ "module",
156
+ [
157
+ "typescript",
158
+ {
159
+ "project": "tsconfig.build.json"
160
+ }
161
+ ]
162
+ ]
163
+ }
164
+ }
package/src/IDWise.js ADDED
@@ -0,0 +1,123 @@
1
+ import { NativeModules, Platform } from 'react-native';
2
+ import {
3
+ setInitializeEventListeners,
4
+ setJourneyEventListeners,
5
+ setJourneySummaryEventListener,
6
+ setStepEventListeners,
7
+ } from './IDWiseEventListeners';
8
+
9
+ const LINKING_ERROR =
10
+ `The package 'idwise-mobile-sdk' doesn't seem to be linked. Make sure: \n\n` +
11
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
12
+ '- You rebuilt the app after installing the package\n' +
13
+ '- You are not using Expo Go\n';
14
+
15
+ const RNIDWise = NativeModules.IdwiseMobileSdk
16
+ ? NativeModules.IdwiseMobileSdk
17
+ : new Proxy(
18
+ {},
19
+ {
20
+ get() {
21
+ throw new Error(LINKING_ERROR);
22
+ },
23
+ }
24
+ );
25
+
26
+ const initialize = (clientKey, theme, callback) => {
27
+ console.log('IDWise - initialize');
28
+ setInitializeEventListeners(callback);
29
+
30
+ RNIDWise.initialize(clientKey, theme);
31
+ };
32
+
33
+ const startJourney = (
34
+ journeyDefinitionId,
35
+ referenceNo,
36
+ locale,
37
+ journeyCallback
38
+ ) => {
39
+ console.log('IDWise - startJourney');
40
+ setJourneyEventListeners(journeyCallback);
41
+ setStepEventListeners(null);
42
+
43
+ RNIDWise.startJourney(journeyDefinitionId, referenceNo, locale);
44
+ };
45
+
46
+ const startDynamicJourney = (
47
+ journeyDefinitionId,
48
+ referenceNo,
49
+ locale,
50
+ journeyCallback,
51
+ stepCallback
52
+ ) => {
53
+ console.log('IDWise - startDynamicJourney');
54
+ setJourneyEventListeners(journeyCallback);
55
+ setStepEventListeners(stepCallback);
56
+
57
+ RNIDWise.startDynamicJourney(journeyDefinitionId, referenceNo, locale);
58
+ };
59
+
60
+ const resumeDynamicJourney = (
61
+ journeyDefinitionId,
62
+ journeyId,
63
+ locale,
64
+ journeyCallback,
65
+ stepCallback
66
+ ) => {
67
+ console.log('IDWise - resumeDynamicJourney');
68
+ setJourneyEventListeners(journeyCallback);
69
+ setStepEventListeners(stepCallback);
70
+
71
+ RNIDWise.resumeDynamicJourney(journeyDefinitionId, journeyId, locale);
72
+ };
73
+
74
+
75
+ const resumeJourney = (
76
+ journeyDefinitionId,
77
+ journeyId,
78
+ locale,
79
+ journeyCallback
80
+ ) => {
81
+ console.log('IDWise - resumeJourney');
82
+ setJourneyEventListeners(journeyCallback);
83
+
84
+ RNIDWise.resumeJourney(journeyDefinitionId, journeyId, locale);
85
+ };
86
+
87
+
88
+ const startStep = (stepId) => RNIDWise.startStep(stepId);
89
+
90
+ const skipStep = (stepId) => RNIDWise.skipStep(stepId);
91
+
92
+ const getJourneySummary = (callback) => {
93
+ console.log('IDWise - getJourneySummary');
94
+ setJourneySummaryEventListener(callback);
95
+
96
+ RNIDWise.getJourneySummary();
97
+ };
98
+
99
+
100
+ const finishDynamicJourney = () => {
101
+ console.log('IDWise - finishDynamicJourney');
102
+
103
+ RNIDWise.finishDynamicJourney();
104
+ };
105
+
106
+ const unloadSDK = () => {
107
+ console.log('IDWise - unloadSDK');
108
+ RNIDWise.unloadSDK();
109
+ };
110
+
111
+ export const IDWise = {
112
+ initialize,
113
+ startJourney,
114
+ startDynamicJourney,
115
+ resumeDynamicJourney,
116
+ startStep,
117
+ getJourneySummary,
118
+ finishDynamicJourney,
119
+ skipStep,
120
+ //TODO: uncomment below once it is implemented on iOS
121
+ //resumeJourney,
122
+ unloadSDK,
123
+ };
@@ -0,0 +1,23 @@
1
+ export const IDWiseEvents = {
2
+ EVENT_INITIALIZE_ERRROR: 'onInitializeError',
3
+
4
+ EVENT_JOURNEY_STARTED: 'onJourneyStarted',
5
+ EVENT_JOURNEY_RESUMED: 'onJourneyResumed',
6
+ EVENT_JOURNEY_FINISHED: 'onJourneyFinished',
7
+ EVENT_JOURNEY_CANCELLED: 'onJourneyCancelled',
8
+ EVENT_JOURNEY_ERROR: 'onJourneyError',
9
+
10
+ EVENT_JOURNEY_SUMMARY: 'onJourneySummary',
11
+ EVENT_JOURNEY_SUMMARY_ERROR: 'onJourneySummaryError',
12
+
13
+ EVENT_STEP_CAPTURED: 'onStepCaptured',
14
+ EVENT_STEP_RESULT: 'onStepResult',
15
+ EVENT_STEP_CANCELLED: 'onStepCancelled',
16
+ EVENT_STEP_SKIPPED: 'onStepSkipped',
17
+ };
18
+
19
+ export const IDWiseSDKTheme = {
20
+ LIGHT: 'LIGHT',
21
+ DARK: 'DARK',
22
+ SYSTEM_DEFAULT: 'SYSTEM_DEFAULT',
23
+ };
@@ -0,0 +1,105 @@
1
+ import { NativeEventEmitter, NativeModules } from 'react-native';
2
+ import { IDWiseEvents } from './IDWiseConstants';
3
+
4
+ const RNIDWise = NativeModules.IdwiseMobileSdk
5
+ ? NativeModules.IdwiseMobileSdk
6
+ : new Proxy(
7
+ {},
8
+ {
9
+ get() {
10
+ throw new Error(LINKING_ERROR);
11
+ },
12
+ }
13
+ );
14
+
15
+ const eventEmitter = new NativeEventEmitter(RNIDWise);
16
+
17
+ const setInitializeEventListeners = (idwiseInitializeCallback) => {
18
+ console.log('IDWise - setInitializeEventListeners');
19
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_INITIALIZE_ERRROR);
20
+
21
+ eventEmitter.addListener(IDWiseEvents.EVENT_INITIALIZE_ERRROR, (event) => {
22
+ idwiseInitializeCallback?.onError(event);
23
+ });
24
+ };
25
+
26
+ const setJourneyEventListeners = (idwiseJourneyCallback) => {
27
+ console.log('IDWise - setJourneyEventListeners');
28
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_JOURNEY_STARTED);
29
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_JOURNEY_RESUMED);
30
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_JOURNEY_FINISHED);
31
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_JOURNEY_CANCELLED);
32
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_JOURNEY_ERROR);
33
+
34
+ eventEmitter.addListener(IDWiseEvents.EVENT_JOURNEY_STARTED, (event) => {
35
+ idwiseJourneyCallback?.onJourneyStarted(event);
36
+ });
37
+
38
+ eventEmitter.addListener(IDWiseEvents.EVENT_JOURNEY_RESUMED, (event) => {
39
+ idwiseJourneyCallback?.onJourneyResumed(event);
40
+ });
41
+
42
+ eventEmitter.addListener(IDWiseEvents.EVENT_JOURNEY_FINISHED, (event) => {
43
+ idwiseJourneyCallback?.onJourneyFinished(event);
44
+ });
45
+
46
+ eventEmitter.addListener(IDWiseEvents.EVENT_JOURNEY_CANCELLED, (event) => {
47
+ idwiseJourneyCallback?.onJourneyCancelled(event);
48
+ });
49
+
50
+ eventEmitter.addListener(IDWiseEvents.EVENT_JOURNEY_ERROR, (event) => {
51
+ idwiseJourneyCallback?.onError(event);
52
+ });
53
+ };
54
+
55
+ const setStepEventListeners = (idwiseStepCallback) => {
56
+ console.log('IDWise - setStepEventListener');
57
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_STEP_CAPTURED);
58
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_STEP_RESULT);
59
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_STEP_CANCELLED);
60
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_STEP_SKIPPED);
61
+
62
+ eventEmitter.addListener(IDWiseEvents.EVENT_STEP_CAPTURED, (event) => {
63
+ idwiseStepCallback?.onStepCaptured(event.stepId, event.capturedImage);
64
+ });
65
+
66
+ eventEmitter.addListener(IDWiseEvents.EVENT_STEP_RESULT, (event) => {
67
+ idwiseStepCallback?.onStepResult(
68
+ event.stepId,
69
+ JSON.parse(event.stepResult)
70
+ );
71
+ });
72
+
73
+ eventEmitter.addListener(IDWiseEvents.EVENT_STEP_CANCELLED, (event) => {
74
+ idwiseStepCallback?.onStepCancelled(event);
75
+ });
76
+
77
+ eventEmitter.addListener(IDWiseEvents.EVENT_STEP_SKIPPED, (event) => {
78
+ idwiseStepCallback?.onStepSkipped(event);
79
+ });
80
+ };
81
+
82
+ const setJourneySummaryEventListener = (idwiseJourneySummaryCallback) => {
83
+ console.log('IDWise - setJourneySummaryEventListener');
84
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_JOURNEY_SUMMARY);
85
+ eventEmitter.removeAllListeners(IDWiseEvents.EVENT_JOURNEY_SUMMARY_ERROR);
86
+
87
+ eventEmitter.addListener(IDWiseEvents.EVENT_JOURNEY_SUMMARY, (event) => {
88
+ idwiseJourneySummaryCallback?.onJourneySummary(JSON.parse(event.summary));
89
+ });
90
+
91
+ eventEmitter.addListener(
92
+ IDWiseEvents.EVENT_JOURNEY_SUMMARY_ERROR,
93
+ (event) => {
94
+ idwiseJourneySummaryCallback?.onError(JSON.parse(event.error));
95
+ }
96
+ );
97
+ };
98
+
99
+ export {
100
+ setInitializeEventListeners,
101
+ setJourneyEventListeners,
102
+ setJourneySummaryEventListener,
103
+ setStepEventListeners
104
+ };
105
+
package/src/index.js ADDED
@@ -0,0 +1,4 @@
1
+ import * as IDWise from './IDWise';
2
+ import { IDWiseSDKTheme } from './IDWiseConstants';
3
+
4
+ export default { IDWise, IDWiseSDKTheme };