react-native-okhi 1.2.17 → 1.2.18-beta.2

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 (96) hide show
  1. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  2. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  3. package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
  4. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  5. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  6. package/android/.gradle/8.9/gc.properties +0 -0
  7. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  8. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  9. package/android/.gradle/vcs-1/gc.properties +0 -0
  10. package/android/build.gradle +2 -2
  11. package/android/src/main/java/com/reactnativeokhi/OkhiModule.java +25 -11
  12. package/ios/Okhi.m +3 -0
  13. package/ios/Okhi.swift +15 -1
  14. package/ios/Okhi.xcodeproj/project.xcworkspace/xcuserdata/kiano.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  15. package/lib/commonjs/OkCollect/Helpers.js +0 -7
  16. package/lib/commonjs/OkCollect/Helpers.js.map +1 -1
  17. package/lib/commonjs/OkCollect/OkHiLocationManager.js +23 -59
  18. package/lib/commonjs/OkCollect/OkHiLocationManager.js.map +1 -1
  19. package/lib/commonjs/OkCollect/Spinner.js +1 -6
  20. package/lib/commonjs/OkCollect/Spinner.js.map +1 -1
  21. package/lib/commonjs/OkCollect/Util.js +21 -49
  22. package/lib/commonjs/OkCollect/Util.js.map +1 -1
  23. package/lib/commonjs/OkCollect/app.json +1 -1
  24. package/lib/commonjs/OkCollect/index.js +0 -5
  25. package/lib/commonjs/OkCollect/index.js.map +1 -1
  26. package/lib/commonjs/OkCollect/types.js.map +1 -1
  27. package/lib/commonjs/OkCore/Helpers.js +16 -90
  28. package/lib/commonjs/OkCore/Helpers.js.map +1 -1
  29. package/lib/commonjs/OkCore/OkHiAuth.js +9 -30
  30. package/lib/commonjs/OkCore/OkHiAuth.js.map +1 -1
  31. package/lib/commonjs/OkCore/OkHiException.js +54 -91
  32. package/lib/commonjs/OkCore/OkHiException.js.map +1 -1
  33. package/lib/commonjs/OkCore/OkHiMode.js +1 -3
  34. package/lib/commonjs/OkCore/OkHiMode.js.map +1 -1
  35. package/lib/commonjs/OkCore/_helpers.js +2 -9
  36. package/lib/commonjs/OkCore/_helpers.js.map +1 -1
  37. package/lib/commonjs/OkCore/_types.js.map +1 -1
  38. package/lib/commonjs/OkCore/index.js +3 -24
  39. package/lib/commonjs/OkCore/index.js.map +1 -1
  40. package/lib/commonjs/OkCore/types.js.map +1 -1
  41. package/lib/commonjs/OkHiNativeModule/index.js +2 -7
  42. package/lib/commonjs/OkHiNativeModule/index.js.map +1 -1
  43. package/lib/commonjs/OkVerify/index.js +19 -87
  44. package/lib/commonjs/OkVerify/index.js.map +1 -1
  45. package/lib/commonjs/OkVerify/types.js.map +1 -1
  46. package/lib/commonjs/index.js +0 -6
  47. package/lib/commonjs/index.js.map +1 -1
  48. package/lib/module/OkCollect/Helpers.js +1 -3
  49. package/lib/module/OkCollect/Helpers.js.map +1 -1
  50. package/lib/module/OkCollect/OkHiLocationManager.js +21 -42
  51. package/lib/module/OkCollect/OkHiLocationManager.js.map +1 -1
  52. package/lib/module/OkCollect/Spinner.js +1 -1
  53. package/lib/module/OkCollect/Spinner.js.map +1 -1
  54. package/lib/module/OkCollect/Util.js +19 -37
  55. package/lib/module/OkCollect/Util.js.map +1 -1
  56. package/lib/module/OkCollect/app.json +1 -1
  57. package/lib/module/OkCollect/index.js.map +1 -1
  58. package/lib/module/OkCollect/types.js.map +1 -1
  59. package/lib/module/OkCore/Helpers.js +17 -56
  60. package/lib/module/OkCore/Helpers.js.map +1 -1
  61. package/lib/module/OkCore/OkHiAuth.js +9 -21
  62. package/lib/module/OkCore/OkHiAuth.js.map +1 -1
  63. package/lib/module/OkCore/OkHiException.js +54 -89
  64. package/lib/module/OkCore/OkHiException.js.map +1 -1
  65. package/lib/module/OkCore/OkHiMode.js.map +1 -1
  66. package/lib/module/OkCore/_helpers.js +2 -4
  67. package/lib/module/OkCore/_helpers.js.map +1 -1
  68. package/lib/module/OkCore/_types.js.map +1 -1
  69. package/lib/module/OkCore/index.js +3 -12
  70. package/lib/module/OkCore/index.js.map +1 -1
  71. package/lib/module/OkCore/types.js.map +1 -1
  72. package/lib/module/OkHiNativeModule/index.js +0 -1
  73. package/lib/module/OkHiNativeModule/index.js.map +1 -1
  74. package/lib/module/OkVerify/index.js +19 -36
  75. package/lib/module/OkVerify/index.js.map +1 -1
  76. package/lib/module/OkVerify/types.js.map +1 -1
  77. package/lib/module/index.js.map +1 -1
  78. package/lib/typescript/OkCollect/OkHiLocationManager.d.ts +2 -1
  79. package/lib/typescript/OkCollect/Spinner.d.ts +2 -1
  80. package/lib/typescript/OkCollect/types.d.ts +5 -4
  81. package/lib/typescript/OkCore/_types.d.ts +3 -3
  82. package/lib/typescript/OkCore/types.d.ts +10 -5
  83. package/lib/typescript/OkHiNativeModule/index.d.ts +2 -3
  84. package/lib/typescript/OkVerify/index.d.ts +5 -11
  85. package/lib/typescript/OkVerify/types.d.ts +0 -5
  86. package/package.json +1 -1
  87. package/react-native-okhi.podspec +1 -1
  88. package/src/OkCollect/OkHiLocationManager.tsx +8 -4
  89. package/src/OkCollect/Util.ts +2 -0
  90. package/src/OkCollect/app.json +1 -1
  91. package/src/OkCollect/types.ts +4 -3
  92. package/src/OkCore/OkHiAuth.ts +5 -0
  93. package/src/OkCore/types.ts +7 -0
  94. package/src/OkHiNativeModule/index.ts +1 -3
  95. package/src/OkVerify/index.ts +19 -21
  96. package/src/OkVerify/types.ts +0 -3
@@ -1,5 +1,4 @@
1
1
  import { NativeModules, NativeEventEmitter, Platform } from 'react-native';
2
- import type { OkVerifyStartConfiguration } from '../OkVerify/types';
3
2
 
4
3
  const LINKING_ERROR =
5
4
  `The package 'react-native-okhi' doesn't seem to be linked. Make sure: \n\n` +
@@ -24,8 +23,7 @@ type OkHiNativeModuleType = {
24
23
  locationId: string,
25
24
  lat: Number,
26
25
  lon: Number,
27
- configuration?: OkVerifyStartConfiguration,
28
- fcmPushNotificationToken?: string
26
+ verificationTypes: string[]
29
27
  ): Promise<string>;
30
28
  stopAddressVerification(
31
29
  phoneNumber: string,
@@ -11,20 +11,17 @@ import {
11
11
  } from '../OkCore/Helpers';
12
12
  import { errorHandler, isValidPlatform } from '../OkCore/_helpers';
13
13
  import { OkHiNativeModule } from '../OkHiNativeModule';
14
- import type { OkVerifyStartConfiguration } from './types';
15
14
  import type { OkCollectSuccessResponse } from '../OkCollect/types';
16
15
  import { OkHiException } from '../OkCore/OkHiException';
17
- export * from './types';
16
+ import type { VerificationType } from '../OkCore';
18
17
  /**
19
18
  * Starts verification for a particular address
20
19
  * @param {string} phoneNumber A users phone number
21
20
  * @param {string} locationId An OkHi location identifier obtained after successfull creation of addresses.
22
21
  * @param {number} lat The latitude of the created address
23
22
  * @param {number} lon The longitude of the created address
24
- * @param {Object} configuration Configures how verification will start on different platforms
25
- * @param {Object} configuration.android Specifices how verification will start on Android platforms
26
- * @param {boolean} configuration.android.withForeground Specifices if the foreground service will be turned on to speed up rate of verification, default is true
27
- * @param {string} fcmPushNotificationToken User's firebase push notification token
23
+ * @param verificationTypes - Optional. An array of verification types that specifies the mode of verification.
24
+ * Can include "physical" and/or "digital" as valid values.
28
25
  * @returns {Promise<string>} A promise that resolves to a string value of the location identifier
29
26
  */
30
27
  export const start = (
@@ -32,25 +29,27 @@ export const start = (
32
29
  locationId: string,
33
30
  lat: number,
34
31
  lon: number,
35
- configuration?: OkVerifyStartConfiguration,
36
- fcmPushNotificationToken?: string
32
+ verificationTypes?: VerificationType
37
33
  ) => {
38
34
  return isValidPlatform(() => {
35
+ const vtypes: VerificationType = Array.isArray(verificationTypes)
36
+ ? verificationTypes
37
+ : ['physical'];
39
38
  if (Platform.OS === 'android') {
40
39
  return OkHiNativeModule.startAddressVerification(
41
40
  phoneNumber,
42
41
  locationId,
43
42
  lat,
44
43
  lon,
45
- configuration,
46
- fcmPushNotificationToken
44
+ vtypes
47
45
  );
48
46
  } else {
49
47
  return OkHiNativeModule.startAddressVerification(
50
48
  phoneNumber,
51
49
  locationId,
52
50
  lat,
53
- lon
51
+ lon,
52
+ vtypes
54
53
  );
55
54
  }
56
55
  });
@@ -59,17 +58,16 @@ export const start = (
59
58
  /**
60
59
  * Starts verification for a particular address using the response object returned by OkCollect
61
60
  * @param {Object} response Response returned by OkCollect
62
- * @param {Object} configuration Configures how verification will start on different platforms
63
- * @param {Object} configuration.android Specifices how verification will start on Android platforms
64
- * @param {boolean} configuration.android.withForeground Specifices if the foreground service will be turned on to speed up rate of verification
65
61
  * @returns {Promise<string>} A promise that resolves to a string value of the location identifier
66
62
  */
67
- export const startVerification = async (
68
- response: OkCollectSuccessResponse,
69
- configuration?: OkVerifyStartConfiguration
70
- ) => {
63
+ export const startVerification = async (response: OkCollectSuccessResponse) => {
71
64
  return new Promise((resolve, reject) => {
72
65
  const { location, user } = response;
66
+ const verificationTypes: VerificationType = Array.isArray(
67
+ response.location.verificationTypes
68
+ )
69
+ ? response.location.verificationTypes
70
+ : ['digital'];
73
71
  if (location.id) {
74
72
  if (Platform.OS === 'android') {
75
73
  const result = OkHiNativeModule.startAddressVerification(
@@ -77,8 +75,7 @@ export const startVerification = async (
77
75
  location.id,
78
76
  location.lat,
79
77
  location.lon,
80
- configuration,
81
- user.fcmPushNotificationToken
78
+ verificationTypes
82
79
  );
83
80
  resolve(result);
84
81
  } else {
@@ -86,7 +83,8 @@ export const startVerification = async (
86
83
  user.phone,
87
84
  location.id,
88
85
  location.lat,
89
- location.lon
86
+ location.lon,
87
+ verificationTypes
90
88
  );
91
89
  resolve(result);
92
90
  }
@@ -1,3 +0,0 @@
1
- export type OkVerifyStartConfiguration = {
2
- android: { withForeground: boolean };
3
- };