react-native-okhi 2.0.19 → 2.0.20
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.
|
@@ -22,27 +22,33 @@ class OkhiModule(reactContext: ReactApplicationContext) : NativeOkhiSpec(reactCo
|
|
|
22
22
|
|
|
23
23
|
val okhiAddressVerificationCallback = object : OkHiAddressVerificationCallback() {
|
|
24
24
|
override fun onClose() {
|
|
25
|
+
val cb = currentCallback
|
|
26
|
+
currentCallback = null
|
|
25
27
|
val error = Arguments.createMap().apply {
|
|
26
28
|
putString("code", "user_closed")
|
|
27
29
|
putString("message", "user closed address creation")
|
|
28
30
|
}
|
|
29
|
-
|
|
31
|
+
cb?.invoke(null, error)
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
override fun onError(e: OkHiException) {
|
|
35
|
+
val cb = currentCallback
|
|
36
|
+
currentCallback = null
|
|
33
37
|
val error = Arguments.createMap().apply {
|
|
34
38
|
putString("code", e.code)
|
|
35
39
|
putString("message", e.message)
|
|
36
40
|
}
|
|
37
|
-
|
|
41
|
+
cb?.invoke(null, error)
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
override fun onSuccess(response: OkHiSuccessResponse) {
|
|
41
|
-
val
|
|
45
|
+
val cb = currentCallback
|
|
46
|
+
currentCallback = null
|
|
47
|
+
val responseMap = Arguments.createMap().apply {
|
|
42
48
|
putString("user", response.user.toJSON().toString())
|
|
43
49
|
putString("location", response.location.toJSON().toString())
|
|
44
50
|
}
|
|
45
|
-
|
|
51
|
+
cb?.invoke(responseMap, null)
|
|
46
52
|
}
|
|
47
53
|
}
|
|
48
54
|
|
|
@@ -194,7 +200,7 @@ class OkhiModule(reactContext: ReactApplicationContext) : NativeOkhiSpec(reactCo
|
|
|
194
200
|
} else {
|
|
195
201
|
val styleMap = okcollect.getMap("style")
|
|
196
202
|
val color = styleMap?.getString("color") ?: "#005D67"
|
|
197
|
-
val logo = styleMap?.getString("
|
|
203
|
+
val logo = styleMap?.getString("logo") ?: "https://cdn.okhi.co/icon.png"
|
|
198
204
|
|
|
199
205
|
val configurationMap = okcollect.getMap("configuration")
|
|
200
206
|
val streetView = configurationMap?.getBoolean("streetView") ?: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-okhi",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.20",
|
|
4
4
|
"description": "The OkHi React Native library enables you to collect and verify addresses from your users",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/OkHi/react-native-okhi",
|