omikit-plugin 4.1.2 → 4.1.4

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.1
5
+ **Status:** Active maintenance | **Version:** 4.1.4
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.6 |
50
- | iOS | OmiKit | 1.11.4 |
49
+ | Android | OMIKIT | 2.6.9 |
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
 
@@ -65,7 +65,7 @@ dependencies {
65
65
  // OMISDK
66
66
  implementation("androidx.work:work-runtime:2.8.1")
67
67
  implementation "androidx.security:security-crypto:1.1.0-alpha06"
68
- api "io.omicrm.vihat:omi-sdk:2.6.8"
68
+ api "io.omicrm.vihat:omi-sdk:2.6.9"
69
69
 
70
70
  // React Native — resolved from consumer's node_modules
71
71
  implementation "com.facebook.react:react-native:+"
@@ -1157,8 +1157,8 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
1157
1157
  var callResult: Any? = null
1158
1158
  withContext(Dispatchers.Default) {
1159
1159
  try {
1160
- // Gọi trực tiếp getCurrentUser() trong coroutine context
1161
- callResult = OmiClient.getInstance(reactApplicationContext!!).getCurrentUser()
1160
+ val omiClient = OmiClient.getInstance(reactApplicationContext!!)
1161
+ callResult = omiClient.getCurrentUser()
1162
1162
  } catch (e: Throwable) {
1163
1163
  Log.e("OmikitPlugin", "❌ getCurrentUser error: ${e.message}", e)
1164
1164
  }
@@ -1174,8 +1174,10 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
1174
1174
  map.putString("fullName", call["full_name"] as String?)
1175
1175
  map.putString("avatarUrl", call["avatar_url"] as String?)
1176
1176
 
1177
+ Log.d("OmikitPlugin", "✅ getCurrentUser resolved: extension=${call["extension"]}, uuid=${call["uuid"]}, full_name=${call["full_name"]}")
1177
1178
  promise.resolve(map)
1178
1179
  } else {
1180
+ Log.w("OmikitPlugin", "⚠️ getCurrentUser resolved NULL — callResult=$callResult, isMap=${callResult is Map<*, *>}")
1179
1181
  promise.resolve(null);
1180
1182
  }
1181
1183
  }
@@ -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
- resolve(user)
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omikit-plugin",
3
- "version": "4.1.2",
3
+ "version": "4.1.4",
4
4
  "description": "Omikit Plugin by ViHAT",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",