omikit-plugin 3.2.44 → 3.2.45
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.
|
@@ -625,28 +625,28 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
625
625
|
}
|
|
626
626
|
|
|
627
627
|
@ReactMethod
|
|
628
|
-
|
|
628
|
+
fun getUserInfo(phone: String, promise: Promise) {
|
|
629
629
|
mainScope.launch {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
630
|
+
var callResult: Any? = null
|
|
631
|
+
withContext(Dispatchers.Default) {
|
|
632
|
+
try {
|
|
633
|
+
callResult = OmiClient.getInstance(reactApplicationContext!!).getUserInfo(phone)
|
|
634
|
+
} catch (_: Throwable) {
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
if (callResult != null && callResult is Map<*, *>) {
|
|
638
|
+
val call = callResult as Map<*, *>
|
|
639
|
+
val map: WritableMap = WritableNativeMap()
|
|
640
|
+
map.putString("extension", call["extension"] as String?)
|
|
641
|
+
map.putString("uuid", call["uuid"] as String?)
|
|
642
|
+
map.putString("full_name", call["full_name"] as String?)
|
|
643
|
+
map.putString("avatar_url", call["avatar_url"] as String?)
|
|
644
|
+
promise.resolve(map)
|
|
645
|
+
} else {
|
|
646
|
+
promise.resolve(null)
|
|
635
647
|
}
|
|
636
|
-
}
|
|
637
|
-
if (callResult != null && callResult is Map<*, *>) {
|
|
638
|
-
val call = callResult as Map<*, *>
|
|
639
|
-
val map: WritableMap = WritableNativeMap()
|
|
640
|
-
map.putString("extension", call["extension"] as String?)
|
|
641
|
-
map.putString("uuid", call["uuid"] as String?)
|
|
642
|
-
map.putString("full_name", call["full_name"] as String?)
|
|
643
|
-
map.putString("avatar_url", call["avatar_url"] as String?)
|
|
644
|
-
promise.resolve(map)
|
|
645
|
-
} else {
|
|
646
|
-
promise.resolve(null);
|
|
647
|
-
}
|
|
648
648
|
}
|
|
649
|
-
|
|
649
|
+
}
|
|
650
650
|
|
|
651
651
|
@ReactMethod
|
|
652
652
|
fun getAudio(promise: Promise) {
|