omikit-plugin 3.2.43 → 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
- fun getUserInfo(phone: Any, promise: Promise) {
628
+ fun getUserInfo(phone: String, promise: Promise) {
629
629
  mainScope.launch {
630
- var callResult: Any? = null
631
- withContext(Dispatchers.Default) {
632
- try {
633
- callResult = OmiClient.getInstance(reactApplicationContext!!).getUserInfo(phone as String)
634
- } catch (_: Throwable) {
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omikit-plugin",
3
- "version": "3.2.43",
3
+ "version": "3.2.45",
4
4
  "description": "Omikit Plugin by ViHAT",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
package/src/omikit.tsx CHANGED
@@ -257,3 +257,4 @@ export const OmiCallEvent = {
257
257
  onCallQuality: 'CALL_QUALITY',
258
258
  onAudioChange: 'AUDIO_CHANGE',
259
259
  };
260
+
@@ -29,6 +29,19 @@ declare module 'omikit-plugin' {
29
29
  export function transferCall(data: any): Promise<boolean>;
30
30
 
31
31
  export const omiEmitter: NativeEventEmitter;
32
+
33
+ export enum OmiCallState {
34
+ unknown,
35
+ calling,
36
+ incoming,
37
+ early,
38
+ connecting,
39
+ confirmed,
40
+ disconnected,
41
+ }
42
+
43
+
44
+
32
45
 
33
46
  export const OmiCallEvent: {
34
47
  onCallStateChanged: string;