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.
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/reactnativeokhi/OkhiModule.java +25 -11
- package/ios/Okhi.m +3 -0
- package/ios/Okhi.swift +15 -1
- package/ios/Okhi.xcodeproj/project.xcworkspace/xcuserdata/kiano.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/lib/commonjs/OkCollect/Helpers.js +0 -7
- package/lib/commonjs/OkCollect/Helpers.js.map +1 -1
- package/lib/commonjs/OkCollect/OkHiLocationManager.js +23 -59
- package/lib/commonjs/OkCollect/OkHiLocationManager.js.map +1 -1
- package/lib/commonjs/OkCollect/Spinner.js +1 -6
- package/lib/commonjs/OkCollect/Spinner.js.map +1 -1
- package/lib/commonjs/OkCollect/Util.js +21 -49
- package/lib/commonjs/OkCollect/Util.js.map +1 -1
- package/lib/commonjs/OkCollect/app.json +1 -1
- package/lib/commonjs/OkCollect/index.js +0 -5
- package/lib/commonjs/OkCollect/index.js.map +1 -1
- package/lib/commonjs/OkCollect/types.js.map +1 -1
- package/lib/commonjs/OkCore/Helpers.js +16 -90
- package/lib/commonjs/OkCore/Helpers.js.map +1 -1
- package/lib/commonjs/OkCore/OkHiAuth.js +9 -30
- package/lib/commonjs/OkCore/OkHiAuth.js.map +1 -1
- package/lib/commonjs/OkCore/OkHiException.js +54 -91
- package/lib/commonjs/OkCore/OkHiException.js.map +1 -1
- package/lib/commonjs/OkCore/OkHiMode.js +1 -3
- package/lib/commonjs/OkCore/OkHiMode.js.map +1 -1
- package/lib/commonjs/OkCore/_helpers.js +2 -9
- package/lib/commonjs/OkCore/_helpers.js.map +1 -1
- package/lib/commonjs/OkCore/_types.js.map +1 -1
- package/lib/commonjs/OkCore/index.js +3 -24
- package/lib/commonjs/OkCore/index.js.map +1 -1
- package/lib/commonjs/OkCore/types.js.map +1 -1
- package/lib/commonjs/OkHiNativeModule/index.js +2 -7
- package/lib/commonjs/OkHiNativeModule/index.js.map +1 -1
- package/lib/commonjs/OkVerify/index.js +19 -87
- package/lib/commonjs/OkVerify/index.js.map +1 -1
- package/lib/commonjs/OkVerify/types.js.map +1 -1
- package/lib/commonjs/index.js +0 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/OkCollect/Helpers.js +1 -3
- package/lib/module/OkCollect/Helpers.js.map +1 -1
- package/lib/module/OkCollect/OkHiLocationManager.js +21 -42
- package/lib/module/OkCollect/OkHiLocationManager.js.map +1 -1
- package/lib/module/OkCollect/Spinner.js +1 -1
- package/lib/module/OkCollect/Spinner.js.map +1 -1
- package/lib/module/OkCollect/Util.js +19 -37
- package/lib/module/OkCollect/Util.js.map +1 -1
- package/lib/module/OkCollect/app.json +1 -1
- package/lib/module/OkCollect/index.js.map +1 -1
- package/lib/module/OkCollect/types.js.map +1 -1
- package/lib/module/OkCore/Helpers.js +17 -56
- package/lib/module/OkCore/Helpers.js.map +1 -1
- package/lib/module/OkCore/OkHiAuth.js +9 -21
- package/lib/module/OkCore/OkHiAuth.js.map +1 -1
- package/lib/module/OkCore/OkHiException.js +54 -89
- package/lib/module/OkCore/OkHiException.js.map +1 -1
- package/lib/module/OkCore/OkHiMode.js.map +1 -1
- package/lib/module/OkCore/_helpers.js +2 -4
- package/lib/module/OkCore/_helpers.js.map +1 -1
- package/lib/module/OkCore/_types.js.map +1 -1
- package/lib/module/OkCore/index.js +3 -12
- package/lib/module/OkCore/index.js.map +1 -1
- package/lib/module/OkCore/types.js.map +1 -1
- package/lib/module/OkHiNativeModule/index.js +0 -1
- package/lib/module/OkHiNativeModule/index.js.map +1 -1
- package/lib/module/OkVerify/index.js +19 -36
- package/lib/module/OkVerify/index.js.map +1 -1
- package/lib/module/OkVerify/types.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/OkCollect/OkHiLocationManager.d.ts +2 -1
- package/lib/typescript/OkCollect/Spinner.d.ts +2 -1
- package/lib/typescript/OkCollect/types.d.ts +5 -4
- package/lib/typescript/OkCore/_types.d.ts +3 -3
- package/lib/typescript/OkCore/types.d.ts +10 -5
- package/lib/typescript/OkHiNativeModule/index.d.ts +2 -3
- package/lib/typescript/OkVerify/index.d.ts +5 -11
- package/lib/typescript/OkVerify/types.d.ts +0 -5
- package/package.json +1 -1
- package/react-native-okhi.podspec +1 -1
- package/src/OkCollect/OkHiLocationManager.tsx +8 -4
- package/src/OkCollect/Util.ts +2 -0
- package/src/OkCollect/app.json +1 -1
- package/src/OkCollect/types.ts +4 -3
- package/src/OkCore/OkHiAuth.ts +5 -0
- package/src/OkCore/types.ts +7 -0
- package/src/OkHiNativeModule/index.ts +1 -3
- package/src/OkVerify/index.ts +19 -21
- 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
|
-
|
|
28
|
-
fcmPushNotificationToken?: string
|
|
26
|
+
verificationTypes: string[]
|
|
29
27
|
): Promise<string>;
|
|
30
28
|
stopAddressVerification(
|
|
31
29
|
phoneNumber: string,
|
package/src/OkVerify/index.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
|
25
|
-
*
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
}
|
package/src/OkVerify/types.ts
CHANGED