omikit-plugin 4.1.3 → 4.1.5

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/LICENSE CHANGED
@@ -1,20 +1,22 @@
1
- MIT License
1
+ OMICALL SDK License
2
2
 
3
- Copyright (c) 2022 ViHAT Group
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is
9
- furnished to do so, subject to the following conditions:
3
+ Copyright (c) 2022-2026 ViHAT Group (VIHAT JSC). All rights reserved.
10
4
 
11
- The above copyright notice and this permission notice shall be included in all
12
- copies or substantial portions of the Software.
5
+ This SDK is provided exclusively for customers of the OMICALL platform
6
+ (https://omicall.com). By using this SDK, you agree to the following terms:
7
+
8
+ PERMITTED:
9
+ - Use the SDK to integrate OMICALL services into your applications
10
+ - Include the SDK in applications distributed to your end users
11
+
12
+ PROHIBITED:
13
+ - Use the SDK without an active OMICALL account or subscription
14
+ - Redistribute, sublicense, or sell the SDK as a standalone product
15
+ - Use the SDK to build competing communication platforms
16
+ - Reverse engineer, decompile, or disassemble the SDK
13
17
 
14
18
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- SOFTWARE.
19
+ IMPLIED. IN NO EVENT SHALL VIHAT GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY ARISING FROM THE USE OF THIS SOFTWARE.
21
+
22
+ Contact: support@omicall.com
package/README.md CHANGED
@@ -1,8 +1,16 @@
1
1
  # OMICALL SDK for React Native
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/omikit-plugin.svg)](https://www.npmjs.com/package/omikit-plugin)
4
+ [![npm downloads](https://img.shields.io/npm/dm/omikit-plugin.svg)](https://www.npmjs.com/package/omikit-plugin)
5
+ [![license](https://img.shields.io/badge/license-proprietary-red.svg)](./LICENSE)
6
+
7
+ ```bash
8
+ npm install omikit-plugin
9
+ ```
10
+
3
11
  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
12
 
5
- **Status:** Active maintenance | **Version:** 4.1.3
13
+ > **⚠️ Expo is not supported.** This SDK requires native modules (SIP/VoIP, CallKit, PushKit) that are not compatible with Expo managed workflow. Please use React Native CLI.
6
14
 
7
15
  ---
8
16
 
@@ -33,8 +41,8 @@ The [omikit-plugin](https://www.npmjs.com/package/omikit-plugin) enables VoIP/SI
33
41
 
34
42
  | omikit-plugin | React Native | Architecture | Installation |
35
43
  |---------------|--------------|--------------|--------------|
36
- | **4.0.x** (latest) | 0.74+ | Old + New (auto-detect) | `npm install omikit-plugin@latest` |
37
- | 3.3.x | 0.60 – 0.73 | Old Architecture only | `npm install omikit-plugin@3.3.29` |
44
+ | **4.x** (latest) | 0.74+ | Old + New (auto-detect) | `npm install omikit-plugin` |
45
+ | 3.3.x (legacy) | 0.60 – 0.73 | Old Architecture only | `npm install omikit-plugin@3.3.29` |
38
46
 
39
47
  **v4.0.x highlights:**
40
48
  - **TurboModules (JSI)** — 4-10x faster native method calls via direct C++ bridge
@@ -46,7 +54,7 @@ The [omikit-plugin](https://www.npmjs.com/package/omikit-plugin) enables VoIP/SI
46
54
 
47
55
  | Platform | SDK | Version |
48
56
  |----------|-----|---------|
49
- | Android | OMIKIT | 2.6.8 |
57
+ | Android | OMIKIT | 2.6.9 |
50
58
  | iOS | OmiKit | 1.11.9 |
51
59
 
52
60
  ### Platform Requirements
@@ -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:+"
@@ -1153,21 +1153,12 @@ 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}")
1158
1156
  mainScope.launch {
1159
1157
  var callResult: Any? = null
1160
1158
  withContext(Dispatchers.Default) {
1161
1159
  try {
1162
1160
  val omiClient = OmiClient.getInstance(reactApplicationContext!!)
1163
- Log.d("OmikitPlugin", "📍 OmiClient instance: $omiClient")
1164
1161
  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
- }
1171
1162
  } catch (e: Throwable) {
1172
1163
  Log.e("OmikitPlugin", "❌ getCurrentUser error: ${e.message}", e)
1173
1164
  }
@@ -394,9 +394,27 @@ class CallManager {
394
394
  }
395
395
 
396
396
  @objc func callDealloc(_ notification: NSNotification) {
397
- if (tempCallInfo != nil) {
398
- tempCallInfo!["status"] = OMICallState.disconnected.rawValue
399
- OmikitPlugin.instance?.sendEvent(withName: CALL_STATE_CHANGED, body: tempCallInfo!)
397
+ // Extract endCause from OMICallDealloc notification — this is the reliable source
398
+ // for the SIP end code (486=busy, 603=decline, 408=timeout, etc.)
399
+ let endCause = notification.userInfo?[OMINotificationEndCauseKey] as? Int
400
+
401
+ if var info = tempCallInfo, !info.isEmpty {
402
+ info["status"] = OMICallState.disconnected.rawValue
403
+ if let endCause = endCause {
404
+ info["code_end_call"] = endCause
405
+ info["codeEndCall"] = endCause
406
+ }
407
+ OmikitPlugin.instance?.sendEvent(withName: CALL_STATE_CHANGED, body: info)
408
+ tempCallInfo = [:]
409
+ } else if let endCause = endCause {
410
+ // No tempCallInfo (callStateChanged fired first and cleared it),
411
+ // but we still have an endCause — send minimal event so JS gets the code
412
+ let fallback: [String: Any] = [
413
+ "status": OMICallState.disconnected.rawValue,
414
+ "code_end_call": endCause,
415
+ "codeEndCall": endCause
416
+ ]
417
+ OmikitPlugin.instance?.sendEvent(withName: CALL_STATE_CHANGED, body: fallback)
400
418
  }
401
419
  }
402
420
 
@@ -457,7 +475,7 @@ class CallManager {
457
475
  }
458
476
  OmikitPlugin.instance?.sendEvent(withName: CALL_STATE_CHANGED, body: combinedDictionary )
459
477
  lastTimeCall = Date()
460
- tempCallInfo = [:]
478
+ // Keep tempCallInfo for callDealloc — it will clear after use
461
479
  break
462
480
  default:
463
481
  break
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omikit-plugin",
3
- "version": "4.1.3",
3
+ "version": "4.1.5",
4
4
  "description": "Omikit Plugin by ViHAT",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -46,7 +46,7 @@
46
46
  "url": "git+https://github.com/VIHATTeam/OMICALL-React-Native-SDK"
47
47
  },
48
48
  "author": "ViHAT Group <tranhoaihung05@gmail.com>",
49
- "license": "MIT",
49
+ "license": "SEE LICENSE IN LICENSE",
50
50
  "bugs": {
51
51
  "url": "https://github.com/VIHATTeam/OMICALL-React-Native-SDK/issues"
52
52
  },