omikit-plugin 4.1.2 β 4.1.3
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/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The [omikit-plugin](https://www.npmjs.com/package/omikit-plugin) enables VoIP/SIP calling via the OMICALL platform with support for both Old and **New Architecture** (TurboModules + Fabric).
|
|
4
4
|
|
|
5
|
-
**Status:** Active maintenance | **Version:** 4.1.
|
|
5
|
+
**Status:** Active maintenance | **Version:** 4.1.3
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -46,8 +46,8 @@ The [omikit-plugin](https://www.npmjs.com/package/omikit-plugin) enables VoIP/SI
|
|
|
46
46
|
|
|
47
47
|
| Platform | SDK | Version |
|
|
48
48
|
|----------|-----|---------|
|
|
49
|
-
| Android | OMIKIT | 2.6.
|
|
50
|
-
| iOS | OmiKit | 1.11.
|
|
49
|
+
| Android | OMIKIT | 2.6.8 |
|
|
50
|
+
| iOS | OmiKit | 1.11.9 |
|
|
51
51
|
|
|
52
52
|
### Platform Requirements
|
|
53
53
|
|
|
@@ -128,6 +128,14 @@ Add to `android/app/src/main/AndroidManifest.xml`:
|
|
|
128
128
|
> <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA"
|
|
129
129
|
> tools:node="remove" />
|
|
130
130
|
> ```
|
|
131
|
+
|
|
132
|
+
> **Note:** By default, the SDK declares `WRITE_CALL_LOG` permission to save calls to the device's call history. If your app does **NOT** want calls saved to the device call log, add the following to remove it:
|
|
133
|
+
>
|
|
134
|
+
> ```xml
|
|
135
|
+
> <!-- Remove if you do NOT want calls saved to device call history -->
|
|
136
|
+
> <uses-permission android:name="android.permission.WRITE_CALL_LOG"
|
|
137
|
+
> tools:node="remove" />
|
|
138
|
+
> ```
|
|
131
139
|
>
|
|
132
140
|
> Make sure to add the `tools` namespace to your manifest tag: `xmlns:tools="http://schemas.android.com/tools"`
|
|
133
141
|
|
|
@@ -1153,12 +1153,21 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1153
1153
|
|
|
1154
1154
|
@ReactMethod
|
|
1155
1155
|
fun getCurrentUser(promise: Promise) {
|
|
1156
|
+
Log.d("OmikitPlugin", "π getCurrentUser called")
|
|
1157
|
+
Log.d("OmikitPlugin", "π reactApplicationContext is null? ${reactApplicationContext == null}")
|
|
1156
1158
|
mainScope.launch {
|
|
1157
1159
|
var callResult: Any? = null
|
|
1158
1160
|
withContext(Dispatchers.Default) {
|
|
1159
1161
|
try {
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
+
val omiClient = OmiClient.getInstance(reactApplicationContext!!)
|
|
1163
|
+
Log.d("OmikitPlugin", "π OmiClient instance: $omiClient")
|
|
1164
|
+
callResult = omiClient.getCurrentUser()
|
|
1165
|
+
Log.d("OmikitPlugin", "π getCurrentUser raw result: $callResult")
|
|
1166
|
+
Log.d("OmikitPlugin", "π result type: ${callResult?.javaClass?.name ?: "null"}")
|
|
1167
|
+
if (callResult is Map<*, *>) {
|
|
1168
|
+
Log.d("OmikitPlugin", "π result keys: ${(callResult as Map<*, *>).keys}")
|
|
1169
|
+
Log.d("OmikitPlugin", "π result values: ${(callResult as Map<*, *>).values}")
|
|
1170
|
+
}
|
|
1162
1171
|
} catch (e: Throwable) {
|
|
1163
1172
|
Log.e("OmikitPlugin", "β getCurrentUser error: ${e.message}", e)
|
|
1164
1173
|
}
|
|
@@ -1174,8 +1183,10 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1174
1183
|
map.putString("fullName", call["full_name"] as String?)
|
|
1175
1184
|
map.putString("avatarUrl", call["avatar_url"] as String?)
|
|
1176
1185
|
|
|
1186
|
+
Log.d("OmikitPlugin", "β
getCurrentUser resolved: extension=${call["extension"]}, uuid=${call["uuid"]}, full_name=${call["full_name"]}")
|
|
1177
1187
|
promise.resolve(map)
|
|
1178
1188
|
} else {
|
|
1189
|
+
Log.w("OmikitPlugin", "β οΈ getCurrentUser resolved NULL β callResult=$callResult, isMap=${callResult is Map<*, *>}")
|
|
1179
1190
|
promise.resolve(null);
|
|
1180
1191
|
}
|
|
1181
1192
|
}
|
|
@@ -198,7 +198,7 @@ class CallManager {
|
|
|
198
198
|
|
|
199
199
|
// Use host as SIP proxy (matching Android behavior)
|
|
200
200
|
let host = (params["host"] as? String) ?? ""
|
|
201
|
-
let proxy = host.isEmpty ? "" : host
|
|
201
|
+
let proxy = host.isEmpty ? "vh.omicrm.com" : host
|
|
202
202
|
|
|
203
203
|
// Set FCM project ID if provided
|
|
204
204
|
if let projectID = params["projectId"] as? String, !projectID.isEmpty {
|
|
@@ -462,8 +462,18 @@ public class OmikitPlugin: RCTEventEmitter {
|
|
|
462
462
|
|
|
463
463
|
@objc(getCurrentUser:rejecter:)
|
|
464
464
|
func getCurrentUser(resolve: @escaping RCTPromiseResolveBlock, reject:RCTPromiseRejectBlock) -> Void {
|
|
465
|
+
let currentSip = OmiClient.getCurrentSip()
|
|
466
|
+
NSLog("π [RN-getCurrentUser] called β currentSip: \(currentSip ?? "nil")")
|
|
465
467
|
CallManager.shareInstance().getCurrentUser { user in
|
|
466
|
-
|
|
468
|
+
NSLog("π [RN-getCurrentUser] callback result: \(user)")
|
|
469
|
+
NSLog("π [RN-getCurrentUser] isEmpty: \(user.isEmpty), keys: \(Array(user.keys))")
|
|
470
|
+
if user.isEmpty {
|
|
471
|
+
NSLog("β οΈ [RN-getCurrentUser] resolved empty dict β user not found for sip: \(currentSip ?? "nil")")
|
|
472
|
+
resolve(nil)
|
|
473
|
+
} else {
|
|
474
|
+
NSLog("β
[RN-getCurrentUser] resolved: extension=\(user["extension"] ?? "nil"), uuid=\(user["uuid"] ?? "nil")")
|
|
475
|
+
resolve(user)
|
|
476
|
+
}
|
|
467
477
|
}
|
|
468
478
|
}
|
|
469
479
|
|