omikit-plugin 4.1.0 → 4.1.2
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 +449 -63
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/omikitplugin/OmiLocalCameraView.kt +21 -39
- package/android/src/main/java/com/omikitplugin/OmiRemoteCameraView.kt +40 -22
- package/android/src/main/java/com/omikitplugin/OmikitPluginModule.kt +28 -15
- package/android/src/main/java/com/omikitplugin/OmikitPluginPackage.kt +58 -22
- package/ios/Library/OmikitPlugin.swift +7 -7
- package/lib/commonjs/NativeOmikitPlugin.js.map +1 -1
- package/lib/commonjs/omikit.js +18 -0
- package/lib/commonjs/omikit.js.map +1 -1
- package/lib/module/NativeOmikitPlugin.js.map +1 -1
- package/lib/module/omikit.js +16 -0
- package/lib/module/omikit.js.map +1 -1
- package/omikit-plugin.podspec +32 -24
- package/package.json +1 -1
- package/src/NativeOmikitPlugin.ts +6 -0
- package/src/omikit.tsx +16 -0
|
@@ -5,7 +5,7 @@ import android.util.Log
|
|
|
5
5
|
import android.view.Surface
|
|
6
6
|
import android.view.TextureView
|
|
7
7
|
import android.view.ViewGroup
|
|
8
|
-
import android.widget.
|
|
8
|
+
import android.widget.FrameLayout
|
|
9
9
|
import com.facebook.react.bridge.Promise
|
|
10
10
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
11
11
|
import com.facebook.react.bridge.ReactMethod
|
|
@@ -17,24 +17,25 @@ import vn.vihat.omicall.omisdk.videoutils.ScaleManager
|
|
|
17
17
|
import vn.vihat.omicall.omisdk.videoutils.Size
|
|
18
18
|
|
|
19
19
|
class OmiLocalCameraView(private val context: ReactApplicationContext) :
|
|
20
|
-
SimpleViewManager<
|
|
20
|
+
SimpleViewManager<FrameLayout>() {
|
|
21
21
|
|
|
22
|
-
val localView:
|
|
22
|
+
val localView: FrameLayout = FrameLayout(context)
|
|
23
23
|
private val cameraView: TextureView = TextureView(context)
|
|
24
24
|
|
|
25
|
-
// Track whether the surface is ready for rendering
|
|
26
25
|
@Volatile
|
|
27
26
|
private var isSurfaceReady = false
|
|
28
|
-
|
|
29
|
-
// Queued refresh — executed when surface becomes available
|
|
30
27
|
private var pendingRefreshPromise: Promise? = null
|
|
31
28
|
|
|
32
29
|
init {
|
|
33
|
-
|
|
30
|
+
// TextureView fills container — RN styles (width/height) control the FrameLayout
|
|
31
|
+
localView.addView(cameraView, FrameLayout.LayoutParams(
|
|
32
|
+
FrameLayout.LayoutParams.MATCH_PARENT,
|
|
33
|
+
FrameLayout.LayoutParams.MATCH_PARENT
|
|
34
|
+
))
|
|
35
|
+
|
|
34
36
|
cameraView.surfaceTextureListener = object : TextureView.SurfaceTextureListener {
|
|
35
37
|
override fun onSurfaceTextureAvailable(surface: SurfaceTexture, width: Int, height: Int) {
|
|
36
38
|
isSurfaceReady = true
|
|
37
|
-
// Execute queued refresh if any
|
|
38
39
|
pendingRefreshPromise?.let { promise ->
|
|
39
40
|
pendingRefreshPromise = null
|
|
40
41
|
doRefresh(promise)
|
|
@@ -46,36 +47,28 @@ class OmiLocalCameraView(private val context: ReactApplicationContext) :
|
|
|
46
47
|
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture): Boolean {
|
|
47
48
|
isSurfaceReady = false
|
|
48
49
|
pendingRefreshPromise = null
|
|
49
|
-
return
|
|
50
|
+
return false
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
override fun onSurfaceTextureUpdated(surface: SurfaceTexture) {}
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
override fun getName(): String
|
|
57
|
-
return "OmiLocalCameraView"
|
|
58
|
-
}
|
|
57
|
+
override fun getName(): String = "OmiLocalCameraView"
|
|
59
58
|
|
|
60
|
-
override fun createViewInstance(p0: ThemedReactContext):
|
|
61
|
-
// Detach from previous parent if remounted
|
|
62
|
-
// (avoids "The specified child already has a parent" crash)
|
|
59
|
+
override fun createViewInstance(p0: ThemedReactContext): FrameLayout {
|
|
63
60
|
(localView.parent as? ViewGroup)?.removeView(localView)
|
|
64
61
|
return localView
|
|
65
62
|
}
|
|
66
63
|
|
|
67
|
-
fun localViewInstance():
|
|
68
|
-
return localView
|
|
69
|
-
}
|
|
64
|
+
fun localViewInstance(): FrameLayout = localView
|
|
70
65
|
|
|
71
|
-
// Exposed to JS via NativeModules.OmiLocalCameraView.refresh()
|
|
72
66
|
@ReactMethod
|
|
73
67
|
fun refresh(promise: Promise) {
|
|
74
68
|
UiThreadUtil.runOnUiThread {
|
|
75
69
|
if (isSurfaceReady && cameraView.surfaceTexture != null) {
|
|
76
70
|
doRefresh(promise)
|
|
77
71
|
} else {
|
|
78
|
-
// Surface not ready yet — queue and execute when available
|
|
79
72
|
pendingRefreshPromise = promise
|
|
80
73
|
}
|
|
81
74
|
}
|
|
@@ -84,25 +77,14 @@ class OmiLocalCameraView(private val context: ReactApplicationContext) :
|
|
|
84
77
|
private fun doRefresh(promise: Promise) {
|
|
85
78
|
try {
|
|
86
79
|
val surface = Surface(cameraView.surfaceTexture)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
ScaleManager.adjustAspectRatio(
|
|
97
|
-
cameraView,
|
|
98
|
-
Size(cameraView.width, cameraView.height),
|
|
99
|
-
Size(9, 16)
|
|
100
|
-
)
|
|
101
|
-
} catch (e: Exception) {
|
|
102
|
-
Log.e("OmiLocalCameraView", "Error setting up local feed: ${e.message}")
|
|
103
|
-
}
|
|
104
|
-
}, 300)
|
|
105
|
-
|
|
80
|
+
OmiClient.getInstance(context.applicationContext).setupLocalVideoFeed(surface)
|
|
81
|
+
Log.d("OmiLocalCameraView", "Connected local video feed to surface")
|
|
82
|
+
|
|
83
|
+
ScaleManager.adjustAspectRatioCrop(
|
|
84
|
+
cameraView,
|
|
85
|
+
Size(cameraView.width, cameraView.height),
|
|
86
|
+
Size(3, 4)
|
|
87
|
+
)
|
|
106
88
|
promise.resolve(true)
|
|
107
89
|
} catch (e: Exception) {
|
|
108
90
|
Log.e("OmiLocalCameraView", "Error refreshing: ${e.message}")
|
|
@@ -5,6 +5,7 @@ import android.util.Log
|
|
|
5
5
|
import android.view.Surface
|
|
6
6
|
import android.view.TextureView
|
|
7
7
|
import android.view.ViewGroup
|
|
8
|
+
import android.widget.FrameLayout
|
|
8
9
|
import com.facebook.react.bridge.Promise
|
|
9
10
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
10
11
|
import com.facebook.react.bridge.ReactMethod
|
|
@@ -16,22 +17,30 @@ import vn.vihat.omicall.omisdk.videoutils.ScaleManager
|
|
|
16
17
|
import vn.vihat.omicall.omisdk.videoutils.Size
|
|
17
18
|
|
|
18
19
|
class OmiRemoteCameraView(private val context: ReactApplicationContext) :
|
|
19
|
-
SimpleViewManager<
|
|
20
|
+
SimpleViewManager<FrameLayout>() {
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
companion object {
|
|
23
|
+
@Volatile
|
|
24
|
+
var instance: OmiRemoteCameraView? = null
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
val remoteContainer: FrameLayout = FrameLayout(context)
|
|
28
|
+
private val remoteView: TextureView = TextureView(context)
|
|
22
29
|
|
|
23
|
-
// Track whether the surface is ready for rendering
|
|
24
30
|
@Volatile
|
|
25
31
|
private var isSurfaceReady = false
|
|
26
|
-
|
|
27
|
-
// Queued refresh — executed when surface becomes available
|
|
28
32
|
private var pendingRefreshPromise: Promise? = null
|
|
29
33
|
|
|
30
34
|
init {
|
|
35
|
+
instance = this
|
|
36
|
+
remoteContainer.addView(remoteView, FrameLayout.LayoutParams(
|
|
37
|
+
FrameLayout.LayoutParams.MATCH_PARENT,
|
|
38
|
+
FrameLayout.LayoutParams.MATCH_PARENT
|
|
39
|
+
))
|
|
40
|
+
|
|
31
41
|
remoteView.surfaceTextureListener = object : TextureView.SurfaceTextureListener {
|
|
32
42
|
override fun onSurfaceTextureAvailable(surface: SurfaceTexture, width: Int, height: Int) {
|
|
33
43
|
isSurfaceReady = true
|
|
34
|
-
// Execute queued refresh if any
|
|
35
44
|
pendingRefreshPromise?.let { promise ->
|
|
36
45
|
pendingRefreshPromise = null
|
|
37
46
|
doRefresh(promise)
|
|
@@ -43,36 +52,28 @@ class OmiRemoteCameraView(private val context: ReactApplicationContext) :
|
|
|
43
52
|
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture): Boolean {
|
|
44
53
|
isSurfaceReady = false
|
|
45
54
|
pendingRefreshPromise = null
|
|
46
|
-
return
|
|
55
|
+
return false
|
|
47
56
|
}
|
|
48
57
|
|
|
49
58
|
override fun onSurfaceTextureUpdated(surface: SurfaceTexture) {}
|
|
50
59
|
}
|
|
51
60
|
}
|
|
52
61
|
|
|
53
|
-
override fun getName(): String
|
|
54
|
-
return "OmiRemoteCameraView"
|
|
55
|
-
}
|
|
62
|
+
override fun getName(): String = "OmiRemoteCameraView"
|
|
56
63
|
|
|
57
|
-
override fun createViewInstance(p0: ThemedReactContext):
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(remoteView.parent as? ViewGroup)?.removeView(remoteView)
|
|
61
|
-
return remoteView
|
|
64
|
+
override fun createViewInstance(p0: ThemedReactContext): FrameLayout {
|
|
65
|
+
(remoteContainer.parent as? ViewGroup)?.removeView(remoteContainer)
|
|
66
|
+
return remoteContainer
|
|
62
67
|
}
|
|
63
68
|
|
|
64
|
-
fun remoteViewInstance():
|
|
65
|
-
return remoteView
|
|
66
|
-
}
|
|
69
|
+
fun remoteViewInstance(): FrameLayout = remoteContainer
|
|
67
70
|
|
|
68
|
-
// Exposed to JS via NativeModules.OmiRemoteCameraView.refresh()
|
|
69
71
|
@ReactMethod
|
|
70
72
|
fun refresh(promise: Promise) {
|
|
71
73
|
UiThreadUtil.runOnUiThread {
|
|
72
74
|
if (isSurfaceReady && remoteView.surfaceTexture != null) {
|
|
73
75
|
doRefresh(promise)
|
|
74
76
|
} else {
|
|
75
|
-
// Surface not ready yet — queue and execute when available
|
|
76
77
|
pendingRefreshPromise = promise
|
|
77
78
|
}
|
|
78
79
|
}
|
|
@@ -80,15 +81,15 @@ class OmiRemoteCameraView(private val context: ReactApplicationContext) :
|
|
|
80
81
|
|
|
81
82
|
private fun doRefresh(promise: Promise) {
|
|
82
83
|
try {
|
|
83
|
-
// Connect TextureView surface to SDK incoming video feed
|
|
84
84
|
val surface = Surface(remoteView.surfaceTexture)
|
|
85
85
|
OmiClient.getInstance(context.applicationContext).setupIncomingVideoFeed(surface)
|
|
86
86
|
Log.d("OmiRemoteCameraView", "Connected remote video feed to surface")
|
|
87
87
|
|
|
88
|
+
// Default landscape; updated by onVideoSize when PJSIP reports actual dimensions
|
|
88
89
|
ScaleManager.adjustAspectRatio(
|
|
89
90
|
remoteView,
|
|
90
91
|
Size(remoteView.width, remoteView.height),
|
|
91
|
-
Size(
|
|
92
|
+
Size(640, 480)
|
|
92
93
|
)
|
|
93
94
|
promise.resolve(true)
|
|
94
95
|
} catch (e: Exception) {
|
|
@@ -96,4 +97,21 @@ class OmiRemoteCameraView(private val context: ReactApplicationContext) :
|
|
|
96
97
|
promise.resolve(false)
|
|
97
98
|
}
|
|
98
99
|
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Called from OmikitPluginModule.onVideoSize() when PJSIP reports
|
|
103
|
+
* actual remote video dimensions. Re-applies correct aspect ratio.
|
|
104
|
+
*/
|
|
105
|
+
fun updateAspectRatio(videoWidth: Int, videoHeight: Int) {
|
|
106
|
+
UiThreadUtil.runOnUiThread {
|
|
107
|
+
if (remoteView.width > 0 && remoteView.height > 0 && videoWidth > 0 && videoHeight > 0) {
|
|
108
|
+
Log.d("OmiRemoteCameraView", "updateAspectRatio: video=${videoWidth}x${videoHeight}")
|
|
109
|
+
ScaleManager.adjustAspectRatio(
|
|
110
|
+
remoteView,
|
|
111
|
+
Size(remoteView.width, remoteView.height),
|
|
112
|
+
Size(videoWidth, videoHeight)
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
99
117
|
}
|
|
@@ -121,6 +121,11 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
121
121
|
private var isIncoming: Boolean = false
|
|
122
122
|
private var isAnswerCall: Boolean = false
|
|
123
123
|
@Volatile private var permissionPromise: Promise? = null
|
|
124
|
+
|
|
125
|
+
// Helper for bridgeless mode (Expo/RN 0.81+) where currentActivity
|
|
126
|
+
// is not directly available as inherited property
|
|
127
|
+
private val safeActivity: Activity?
|
|
128
|
+
get() = reactApplicationContext?.currentActivity
|
|
124
129
|
|
|
125
130
|
// Call state management to prevent concurrent calls
|
|
126
131
|
private var isCallInProgress: Boolean = false
|
|
@@ -409,7 +414,8 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
409
414
|
}
|
|
410
415
|
|
|
411
416
|
override fun onVideoSize(width: Int, height: Int) {
|
|
412
|
-
|
|
417
|
+
// PJSIP reports actual remote video dimensions — update aspect ratio dynamically
|
|
418
|
+
OmiRemoteCameraView.instance?.updateAspectRatio(width, height)
|
|
413
419
|
}
|
|
414
420
|
|
|
415
421
|
private val accountListener = object : OmiAccountListener {
|
|
@@ -633,7 +639,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
633
639
|
return
|
|
634
640
|
}
|
|
635
641
|
|
|
636
|
-
|
|
642
|
+
safeActivity?.runOnUiThread {
|
|
637
643
|
try {
|
|
638
644
|
// Extract parameters from data with proper defaults
|
|
639
645
|
val notificationIcon = data.getString("notificationIcon") ?: "ic_notification"
|
|
@@ -814,7 +820,14 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
814
820
|
}
|
|
815
821
|
|
|
816
822
|
@ReactMethod
|
|
817
|
-
fun getInitialCall(
|
|
823
|
+
fun getInitialCall(data: ReadableMap, promise: Promise) {
|
|
824
|
+
// JS passes { counter: N } as ReadableMap — extract the counter value.
|
|
825
|
+
// Default to 4 (Android) to allow retries while SIP registers.
|
|
826
|
+
val counter = if (data.hasKey("counter")) data.getInt("counter") else 4
|
|
827
|
+
getInitialCallWithCounter(counter, promise)
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
private fun getInitialCallWithCounter(counter: Int, promise: Promise) {
|
|
818
831
|
val context = reactApplicationContext ?: run {
|
|
819
832
|
promise.resolve(false)
|
|
820
833
|
return
|
|
@@ -827,7 +840,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
827
840
|
} else {
|
|
828
841
|
mainScope.launch {
|
|
829
842
|
delay(1000) // Wait 1 second before retry
|
|
830
|
-
|
|
843
|
+
getInitialCallWithCounter(counter - 1, promise)
|
|
831
844
|
}
|
|
832
845
|
}
|
|
833
846
|
return
|
|
@@ -898,7 +911,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
898
911
|
)
|
|
899
912
|
val map: WritableMap = WritableNativeMap()
|
|
900
913
|
if (audio == PackageManager.PERMISSION_GRANTED) {
|
|
901
|
-
val activity =
|
|
914
|
+
val activity = safeActivity
|
|
902
915
|
if (activity == null) {
|
|
903
916
|
promise.reject("E_NO_ACTIVITY", "Current activity is null")
|
|
904
917
|
return
|
|
@@ -966,7 +979,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
966
979
|
@ReactMethod
|
|
967
980
|
fun joinCall(promise: Promise) {
|
|
968
981
|
val appContext = reactApplicationContext.applicationContext
|
|
969
|
-
val activity =
|
|
982
|
+
val activity = safeActivity
|
|
970
983
|
|
|
971
984
|
if (appContext == null) {
|
|
972
985
|
promise.reject("E_NULL_CONTEXT", "Application context is null")
|
|
@@ -1075,7 +1088,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1075
1088
|
|
|
1076
1089
|
@ReactMethod
|
|
1077
1090
|
fun toggleSpeaker(promise: Promise) {
|
|
1078
|
-
val activity =
|
|
1091
|
+
val activity = safeActivity
|
|
1079
1092
|
if (activity == null) { promise.resolve(null); return }
|
|
1080
1093
|
activity.runOnUiThread {
|
|
1081
1094
|
val newStatus = OmiClient.getInstance(reactApplicationContext!!).toggleSpeaker()
|
|
@@ -1086,7 +1099,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1086
1099
|
|
|
1087
1100
|
@ReactMethod
|
|
1088
1101
|
fun sendDTMF(data: ReadableMap, promise: Promise) {
|
|
1089
|
-
val activity =
|
|
1102
|
+
val activity = safeActivity
|
|
1090
1103
|
if (activity == null) { promise.resolve(false); return }
|
|
1091
1104
|
activity.runOnUiThread {
|
|
1092
1105
|
val character = data.getString("character")
|
|
@@ -1106,7 +1119,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1106
1119
|
|
|
1107
1120
|
@ReactMethod
|
|
1108
1121
|
fun switchOmiCamera(promise: Promise) {
|
|
1109
|
-
val activity =
|
|
1122
|
+
val activity = safeActivity
|
|
1110
1123
|
if (activity == null) { promise.resolve(false); return }
|
|
1111
1124
|
activity.runOnUiThread {
|
|
1112
1125
|
OmiClient.getInstance(reactApplicationContext!!).switchCamera()
|
|
@@ -1116,7 +1129,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1116
1129
|
|
|
1117
1130
|
@ReactMethod
|
|
1118
1131
|
fun toggleOmiVideo(promise: Promise) {
|
|
1119
|
-
val activity =
|
|
1132
|
+
val activity = safeActivity
|
|
1120
1133
|
if (activity == null) { promise.resolve(false); return }
|
|
1121
1134
|
activity.runOnUiThread {
|
|
1122
1135
|
OmiClient.getInstance(reactApplicationContext!!).toggleCamera()
|
|
@@ -1354,7 +1367,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1354
1367
|
|
|
1355
1368
|
@ReactMethod
|
|
1356
1369
|
fun transferCall(data: ReadableMap, promise: Promise) {
|
|
1357
|
-
val activity =
|
|
1370
|
+
val activity = safeActivity
|
|
1358
1371
|
if (activity == null) { promise.resolve(false); return }
|
|
1359
1372
|
activity.runOnUiThread {
|
|
1360
1373
|
val phone = data.getString("phoneNumber")
|
|
@@ -1559,7 +1572,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1559
1572
|
// Store promise for callback
|
|
1560
1573
|
permissionPromise = promise
|
|
1561
1574
|
|
|
1562
|
-
val activity =
|
|
1575
|
+
val activity = safeActivity ?: run {
|
|
1563
1576
|
promise.resolve(false)
|
|
1564
1577
|
return
|
|
1565
1578
|
}
|
|
@@ -1681,7 +1694,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1681
1694
|
Uri.parse("package:${reactApplicationContext.packageName}")
|
|
1682
1695
|
)
|
|
1683
1696
|
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
|
1684
|
-
|
|
1697
|
+
safeActivity?.startActivityForResult(intent, REQUEST_OVERLAY_PERMISSION_CODE)
|
|
1685
1698
|
} else {
|
|
1686
1699
|
promise.resolve(true)
|
|
1687
1700
|
}
|
|
@@ -1737,7 +1750,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1737
1750
|
// Store promise for callback
|
|
1738
1751
|
permissionPromise = promise
|
|
1739
1752
|
|
|
1740
|
-
val activity =
|
|
1753
|
+
val activity = safeActivity ?: run {
|
|
1741
1754
|
promise.reject("E_NULL_ACTIVITY", "Current activity is null")
|
|
1742
1755
|
return
|
|
1743
1756
|
}
|
|
@@ -1759,7 +1772,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1759
1772
|
return
|
|
1760
1773
|
}
|
|
1761
1774
|
|
|
1762
|
-
val activity =
|
|
1775
|
+
val activity = safeActivity ?: return
|
|
1763
1776
|
ActivityCompat.requestPermissions(
|
|
1764
1777
|
activity,
|
|
1765
1778
|
missingPermissions.toTypedArray(),
|
|
@@ -1,39 +1,75 @@
|
|
|
1
1
|
package com.omikitplugin
|
|
2
2
|
|
|
3
|
-
import com.facebook.react.
|
|
3
|
+
import com.facebook.react.TurboReactPackage
|
|
4
4
|
import com.facebook.react.bridge.NativeModule
|
|
5
5
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
+
import com.facebook.react.module.model.ReactModuleInfo
|
|
7
|
+
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
6
8
|
import com.facebook.react.uimanager.ViewManager
|
|
7
9
|
|
|
10
|
+
class OmikitPluginPackage : TurboReactPackage() {
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
// Cache shared instances so the NativeModule interface and ViewManager interface
|
|
13
|
+
// refer to the same object — required for NativeModules.OmiLocalCameraView.refresh() to
|
|
14
|
+
// affect the view that React Native is actually rendering.
|
|
11
15
|
private var localView: OmiLocalCameraView? = null
|
|
12
16
|
private var remoteView: OmiRemoteCameraView? = null
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
if (localView == null)
|
|
16
|
-
|
|
18
|
+
private fun getLocalView(reactContext: ReactApplicationContext): OmiLocalCameraView {
|
|
19
|
+
if (localView == null) localView = OmiLocalCameraView(reactContext)
|
|
20
|
+
return localView!!
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
private fun getRemoteView(reactContext: ReactApplicationContext): OmiRemoteCameraView {
|
|
24
|
+
if (remoteView == null) remoteView = OmiRemoteCameraView(reactContext)
|
|
25
|
+
return remoteView!!
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
29
|
+
return when (name) {
|
|
30
|
+
OmikitPluginModule.NAME -> OmikitPluginModule(reactContext)
|
|
31
|
+
"OmiLocalCameraView" -> getLocalView(reactContext)
|
|
32
|
+
"OmiRemoteCameraView" -> getRemoteView(reactContext)
|
|
33
|
+
else -> null
|
|
17
34
|
}
|
|
18
|
-
|
|
19
|
-
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
|
|
38
|
+
return ReactModuleInfoProvider {
|
|
39
|
+
// isTurboModule = false because OmikitPluginModule extends ReactContextBaseJavaModule,
|
|
40
|
+
// not the codegen-generated spec class. The RN interop layer automatically wraps
|
|
41
|
+
// it for New Architecture / bridgeless mode. Set to true only after migrating
|
|
42
|
+
// OmikitPluginModule to extend NativeOmikitPluginSpec.
|
|
43
|
+
mapOf(
|
|
44
|
+
OmikitPluginModule.NAME to ReactModuleInfo(
|
|
45
|
+
OmikitPluginModule.NAME,
|
|
46
|
+
OmikitPluginModule.NAME,
|
|
47
|
+
false, // canOverrideExistingModule
|
|
48
|
+
false, // needsEagerInit
|
|
49
|
+
false, // isCxxModule
|
|
50
|
+
false // isTurboModule — interop layer handles New Arch
|
|
51
|
+
),
|
|
52
|
+
// ViewManagers also registered as NativeModules so JS can call
|
|
53
|
+
// NativeModules.OmiLocalCameraView.refresh() etc.
|
|
54
|
+
"OmiLocalCameraView" to ReactModuleInfo(
|
|
55
|
+
"OmiLocalCameraView",
|
|
56
|
+
"OmiLocalCameraView",
|
|
57
|
+
false, false, false, false
|
|
58
|
+
),
|
|
59
|
+
"OmiRemoteCameraView" to ReactModuleInfo(
|
|
60
|
+
"OmiRemoteCameraView",
|
|
61
|
+
"OmiRemoteCameraView",
|
|
62
|
+
false, false, false, false
|
|
63
|
+
),
|
|
64
|
+
)
|
|
20
65
|
}
|
|
21
|
-
// ViewManagers are also NativeModules — refresh() is accessible via
|
|
22
|
-
// NativeModules.OmiLocalCameraView and NativeModules.OmiRemoteCameraView
|
|
23
|
-
return listOf(
|
|
24
|
-
OmikitPluginModule(reactContext),
|
|
25
|
-
localView!!,
|
|
26
|
-
remoteView!!,
|
|
27
|
-
)
|
|
28
66
|
}
|
|
29
67
|
|
|
30
68
|
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
return listOf(localView!!, remoteView!!)
|
|
69
|
+
// Reuse cached instances — same objects registered as NativeModules above.
|
|
70
|
+
return listOf(
|
|
71
|
+
getLocalView(reactContext),
|
|
72
|
+
getRemoteView(reactContext),
|
|
73
|
+
)
|
|
38
74
|
}
|
|
39
75
|
}
|
|
@@ -16,13 +16,6 @@ public class OmikitPlugin: RCTEventEmitter {
|
|
|
16
16
|
OmikitPlugin.instance = self
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
// TurboModule conformance
|
|
20
|
-
#if RCT_NEW_ARCH_ENABLED
|
|
21
|
-
@objc public static func moduleName() -> String {
|
|
22
|
-
return "OmikitPlugin"
|
|
23
|
-
}
|
|
24
|
-
#endif
|
|
25
|
-
|
|
26
19
|
@objc public override static func moduleName() -> String! {
|
|
27
20
|
return "OmikitPlugin"
|
|
28
21
|
}
|
|
@@ -733,3 +726,10 @@ public class OmikitPlugin: RCTEventEmitter {
|
|
|
733
726
|
resolve(true)
|
|
734
727
|
}
|
|
735
728
|
}
|
|
729
|
+
|
|
730
|
+
// Declare conformance to codegen-generated TurboModule spec when New Architecture is enabled.
|
|
731
|
+
// All required methods are already implemented in the class above — this extension is
|
|
732
|
+
// the correct Swift pattern for conditional protocol conformance.
|
|
733
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
734
|
+
extension OmikitPlugin: NativeOmikitPluginSpec {}
|
|
735
|
+
#endif
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_default","TurboModuleRegistry","get","exports","default"],"sourceRoot":"../../src","sources":["NativeOmikitPlugin.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","TurboModuleRegistry","get","exports","default"],"sourceRoot":"../../src","sources":["NativeOmikitPlugin.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAqKpCC,gCAAmB,CAACC,GAAG,CAAO,cAAc,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAJ,QAAA"}
|
package/lib/commonjs/omikit.js
CHANGED
|
@@ -18,6 +18,7 @@ exports.getDeviceId = getDeviceId;
|
|
|
18
18
|
exports.getFcmToken = getFcmToken;
|
|
19
19
|
exports.getGuestUser = getGuestUser;
|
|
20
20
|
exports.getInitialCall = getInitialCall;
|
|
21
|
+
exports.getKeepAliveStatus = getKeepAliveStatus;
|
|
21
22
|
exports.getProjectId = getProjectId;
|
|
22
23
|
exports.getSipInfo = getSipInfo;
|
|
23
24
|
exports.getUserInfo = getUserInfo;
|
|
@@ -53,6 +54,7 @@ exports.toggleMute = toggleMute;
|
|
|
53
54
|
exports.toggleOmiVideo = toggleOmiVideo;
|
|
54
55
|
exports.toggleSpeaker = toggleSpeaker;
|
|
55
56
|
exports.transferCall = transferCall;
|
|
57
|
+
exports.triggerKeepAlivePing = triggerKeepAlivePing;
|
|
56
58
|
var _reactNative = require("react-native");
|
|
57
59
|
const LINKING_ERROR = `The package 'omikit-plugin' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
58
60
|
ios: "- You have run 'pod install'\n",
|
|
@@ -556,4 +558,20 @@ function getFcmToken() {
|
|
|
556
558
|
function getVoipToken() {
|
|
557
559
|
return OmikitPlugin.getVoipToken();
|
|
558
560
|
}
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Gets the current keep-alive connection status.
|
|
564
|
+
* @returns {Promise<any>} Keep-alive status object.
|
|
565
|
+
*/
|
|
566
|
+
function getKeepAliveStatus() {
|
|
567
|
+
return OmikitPlugin.getKeepAliveStatus();
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Manually triggers a keep-alive ping to maintain the SIP connection.
|
|
572
|
+
* @returns {Promise<boolean>} True if the ping was sent successfully.
|
|
573
|
+
*/
|
|
574
|
+
function triggerKeepAlivePing() {
|
|
575
|
+
return OmikitPlugin.triggerKeepAlivePing();
|
|
576
|
+
}
|
|
559
577
|
//# sourceMappingURL=omikit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","resolvedModule","turboModule","TurboModuleRegistry","get","_","NativeModules","OmikitPlugin","Proxy","_target","prop","Error","omiEmitter","OS","DeviceEventEmitter","NativeEventEmitter","exports","startServices","configPushNotification","data","getInitialCall","counter","initCallWithUserPassword","initCallWithApiKey","startCall","startCallWithUuid","joinCall","endCall","toggleMute","toggleSpeaker","toggleHold","onHold","sendDTMF","switchOmiCamera","setCameraConfig","config","Promise","resolve","setupVideoContainers","toggleOmiVideo","logout","registerVideoEvent","setupVideoViews","remoteTag","localTag","removeVideoEvent","getCurrentUser","getGuestUser","systemAlertWindow","openSystemAlertSetting","getAudio","setAudio","getCurrentAudio","transferCall","rejectCall","dropCall","hideSystemNotificationSafely","hideSystemNotificationOnly","hideSystemNotificationAndUnregister","reason","OmiCallEvent","onCallStateChanged","onSpeaker","onMuted","onRemoteVideoReady","onClickMissedCall","onSwitchboardAnswer","onCallQuality","onAudioChange","onRequestPermissionAndroid","checkCredentials","registerWithOptions","checkPermissionStatus","checkAndRequestPermissions","isVideo","arguments","length","undefined","requestSystemAlertWindowPermission","requestPermissionsByCodes","codes","getUserInfo","phone","getProjectId","getSipInfo","getAppId","getDeviceId","getFcmToken","getVoipToken"],"sourceRoot":"../../src","sources":["omikit.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","resolvedModule","turboModule","TurboModuleRegistry","get","_","NativeModules","OmikitPlugin","Proxy","_target","prop","Error","omiEmitter","OS","DeviceEventEmitter","NativeEventEmitter","exports","startServices","configPushNotification","data","getInitialCall","counter","initCallWithUserPassword","initCallWithApiKey","startCall","startCallWithUuid","joinCall","endCall","toggleMute","toggleSpeaker","toggleHold","onHold","sendDTMF","switchOmiCamera","setCameraConfig","config","Promise","resolve","setupVideoContainers","toggleOmiVideo","logout","registerVideoEvent","setupVideoViews","remoteTag","localTag","removeVideoEvent","getCurrentUser","getGuestUser","systemAlertWindow","openSystemAlertSetting","getAudio","setAudio","getCurrentAudio","transferCall","rejectCall","dropCall","hideSystemNotificationSafely","hideSystemNotificationOnly","hideSystemNotificationAndUnregister","reason","OmiCallEvent","onCallStateChanged","onSpeaker","onMuted","onRemoteVideoReady","onClickMissedCall","onSwitchboardAnswer","onCallQuality","onAudioChange","onRequestPermissionAndroid","checkCredentials","registerWithOptions","checkPermissionStatus","checkAndRequestPermissions","isVideo","arguments","length","undefined","requestSystemAlertWindowPermission","requestPermissionsByCodes","codes","getUserInfo","phone","getProjectId","getSipInfo","getAppId","getDeviceId","getFcmToken","getVoipToken","getKeepAliveStatus","triggerKeepAlivePing"],"sourceRoot":"../../src","sources":["omikit.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,MAAMC,aAAa,GAChB,wEAAuE,GACxEC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACA,MAAMC,cAA2B,GAAG,CAAC,MAAM;EACzC,IAAI;IACF;IACA,MAAMC,WAAW,GAAGC,gCAAmB,CAACC,GAAG,CAAO,cAAc,CAAC;IACjE,IAAIF,WAAW,EAAE,OAAOA,WAAW;EACrC,CAAC,CAAC,OAAOG,CAAC,EAAE,CAAC;;EAEb;EACA,IAAIC,0BAAa,CAACC,YAAY,EAAE;IAC9B,OAAOD,0BAAa,CAACC,YAAY;EACnC;EAEA,OAAO,IAAI;AACb,CAAC,GAAG;;AAEJ;AACA,MAAMA,YAAkB,GAAGN,cAAc,IAAI,IAAIO,KAAK,CACpD,CAAC,CAAC,EACF;EACEJ,GAAGA,CAACK,OAAO,EAAEC,I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B;EACjD,OAAOlF,YAAY,CAACkF,kBAAkB,EAAE;AAC1C;;AAEA;AACA;AACA;AACA;AACO,SAASC,oBAAoBA,CAAA,EAAqB;EACvD,OAAOnF,YAAY,CAACmF,oBAAoB,EAAE;AAC5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../src","sources":["NativeOmikitPlugin.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../src","sources":["NativeOmikitPlugin.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;AAqKlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,cAAc,CAAC"}
|
package/lib/module/omikit.js
CHANGED
|
@@ -501,4 +501,20 @@ export function getFcmToken() {
|
|
|
501
501
|
export function getVoipToken() {
|
|
502
502
|
return OmikitPlugin.getVoipToken();
|
|
503
503
|
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Gets the current keep-alive connection status.
|
|
507
|
+
* @returns {Promise<any>} Keep-alive status object.
|
|
508
|
+
*/
|
|
509
|
+
export function getKeepAliveStatus() {
|
|
510
|
+
return OmikitPlugin.getKeepAliveStatus();
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Manually triggers a keep-alive ping to maintain the SIP connection.
|
|
515
|
+
* @returns {Promise<boolean>} True if the ping was sent successfully.
|
|
516
|
+
*/
|
|
517
|
+
export function triggerKeepAlivePing() {
|
|
518
|
+
return OmikitPlugin.triggerKeepAlivePing();
|
|
519
|
+
}
|
|
504
520
|
//# sourceMappingURL=omikit.js.map
|