omikit-plugin 3.2.40 → 3.2.42
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 +54 -3
- package/android/src/main/java/com/omikitplugin/OmikitPluginModule.kt +8 -4
- package/lib/commonjs/omikit.js +139 -0
- package/lib/commonjs/omikit.js.map +1 -1
- package/lib/commonjs/types/omikit-plugin.d.js +2 -0
- package/lib/commonjs/types/omikit-plugin.d.js.map +1 -0
- package/lib/module/omikit.js +139 -0
- package/lib/module/omikit.js.map +1 -1
- package/lib/module/types/omikit-plugin.d.js +2 -0
- package/lib/module/types/omikit-plugin.d.js.map +1 -0
- package/package.json +1 -1
- package/src/omikit.tsx +120 -1
- package/src/types/omikit-plugin.d.ts +43 -0
package/README.md
CHANGED
|
@@ -46,9 +46,6 @@ maven {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
dependencies {
|
|
50
|
-
api 'vn.vihat.omicall:omi-sdk:2.3.12'
|
|
51
|
-
}
|
|
52
49
|
```
|
|
53
50
|
```kotlin
|
|
54
51
|
// gradle.properties
|
|
@@ -182,6 +179,7 @@ You can refer <a href="https://github.com/VIHATTeam/OMICALL-React-Native-SDK/blo
|
|
|
182
179
|
```
|
|
183
180
|
|
|
184
181
|
##### In file MainActivity:
|
|
182
|
+
# For React Native < 0.74
|
|
185
183
|
|
|
186
184
|
```java
|
|
187
185
|
public class MainActivity extends ReactActivity {
|
|
@@ -215,6 +213,59 @@ public class MainActivity extends ReactActivity {
|
|
|
215
213
|
}
|
|
216
214
|
```
|
|
217
215
|
|
|
216
|
+
# For React Native > 0.74
|
|
217
|
+
|
|
218
|
+
```kotlin
|
|
219
|
+
class MainActivity : ReactActivity() {
|
|
220
|
+
..... // your config
|
|
221
|
+
private var reactApplicationContext: ReactApplicationContext? = null
|
|
222
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
223
|
+
super.onCreate(savedInstanceState)
|
|
224
|
+
|
|
225
|
+
val reactInstanceManager: ReactInstanceManager = reactNativeHost.reactInstanceManager
|
|
226
|
+
val currentContext = reactInstanceManager.currentReactContext
|
|
227
|
+
if (currentContext != null && currentContext is ReactApplicationContext) {
|
|
228
|
+
reactApplicationContext = currentContext
|
|
229
|
+
Log.d("MainActivity", "ReactApplicationContext is available.")
|
|
230
|
+
} else {
|
|
231
|
+
Log.d("MainActivity", "ReactApplicationContext Not ready yet, will listen to the event.")
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
reactInstanceManager.addReactInstanceEventListener(object : ReactInstanceManager.ReactInstanceEventListener {
|
|
235
|
+
override fun onReactContextInitialized(reactContext: com.facebook.react.bridge.ReactContext) {
|
|
236
|
+
if (reactContext is ReactApplicationContext) {
|
|
237
|
+
reactApplicationContext = reactContext
|
|
238
|
+
Log.d("MainActivity", "ReactApplicationContext đã được khởi tạo.")
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
})
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
override fun onNewIntent(intent: Intent?) {
|
|
245
|
+
super.onNewIntent(intent)
|
|
246
|
+
if (intent != null) {
|
|
247
|
+
reactApplicationContext?.let {
|
|
248
|
+
OmikitPluginModule.Companion.onGetIntentFromNotification(it, intent, this)
|
|
249
|
+
} ?: Log.e("MainActivity", "ReactApplicationContext has not been initialized in onNewIntent.")
|
|
250
|
+
} else {
|
|
251
|
+
Log.e("MainActivity", "Intent in onNewIntent is null.")
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
override fun onResume() {
|
|
255
|
+
super.onResume()
|
|
256
|
+
reactApplicationContext?.let {
|
|
257
|
+
OmikitPluginModule.Companion.onResume(this)
|
|
258
|
+
intent?.let { intent ->
|
|
259
|
+
OmikitPluginModule.Companion.onGetIntentFromNotification(it, intent, this)
|
|
260
|
+
}
|
|
261
|
+
} ?: Log.e("MainActivity", "ReactApplicationContext has not been initialized in onResume.")
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
..... // your config
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
|
|
218
269
|
- Setup remote push notification: Only support Firebase for remote push notification.
|
|
219
270
|
|
|
220
271
|
- Add `google-service.json` in `android/app` (For more information, you can refer <a href="https://rnfirebase.io/app/usage">Core/App</a>)
|
|
@@ -753,11 +753,15 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
753
753
|
}
|
|
754
754
|
|
|
755
755
|
fun sendEvent(eventName: String?, params: Any?) {
|
|
756
|
+
if (eventName == null) {
|
|
757
|
+
Log.e("OmikitPlugin", "eventName is null. Event cannot be emitted.")
|
|
758
|
+
return
|
|
759
|
+
}
|
|
756
760
|
if (currentActivity != null) {
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
+
currentActivity!!.runOnUiThread {
|
|
762
|
+
reactApplicationContext.getJSModule(RCTNativeAppEventEmitter::class.java)
|
|
763
|
+
.emit(eventName, params)
|
|
764
|
+
}
|
|
761
765
|
}
|
|
762
766
|
}
|
|
763
767
|
|
package/lib/commonjs/omikit.js
CHANGED
|
@@ -41,12 +41,28 @@ const OmikitPlugin = _reactNative.NativeModules.OmikitPlugin ? _reactNative.Nati
|
|
|
41
41
|
throw new Error(LINKING_ERROR);
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Starts the Omikit services.
|
|
47
|
+
* @returns {Promise<any>} A promise that resolves when the services start successfully.
|
|
48
|
+
*/
|
|
44
49
|
function startServices() {
|
|
45
50
|
return OmikitPlugin.startServices();
|
|
46
51
|
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Configures push notifications with the given data.
|
|
55
|
+
* @param {any} data - Configuration data for push notifications.
|
|
56
|
+
* @returns {Promise<any>} A promise that resolves when the configuration is complete.
|
|
57
|
+
*/
|
|
47
58
|
function configPushNotification(data) {
|
|
48
59
|
return OmikitPlugin.configPushNotification(data);
|
|
49
60
|
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Retrieves the initial call details when start call
|
|
64
|
+
* @returns {Promise<any>} A promise containing the initial call details.
|
|
65
|
+
*/
|
|
50
66
|
function getInitialCall() {
|
|
51
67
|
if (_reactNative.Platform.OS == "ios") {
|
|
52
68
|
return OmikitPlugin.getInitialCall();
|
|
@@ -54,72 +70,195 @@ function getInitialCall() {
|
|
|
54
70
|
return OmikitPlugin.getInitialCall(4);
|
|
55
71
|
}
|
|
56
72
|
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Login into OMICALL with a username and password.
|
|
76
|
+
* @param {any} data - User credentials for initialization.
|
|
77
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if initialization is successful.
|
|
78
|
+
*/
|
|
57
79
|
function initCallWithUserPassword(data) {
|
|
58
80
|
return OmikitPlugin.initCallWithUserPassword(data);
|
|
59
81
|
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Login into OMICALL with using an API key.
|
|
85
|
+
* @param {any} data - API key and related data.
|
|
86
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if initialization is successful.
|
|
87
|
+
*/
|
|
60
88
|
function initCallWithApiKey(data) {
|
|
61
89
|
return OmikitPlugin.initCallWithApiKey(data);
|
|
62
90
|
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Starts a new call with the given data.
|
|
94
|
+
* @param {any} data - Call configuration data.
|
|
95
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the call starts successfully.
|
|
96
|
+
*/
|
|
63
97
|
function startCall(data) {
|
|
64
98
|
return OmikitPlugin.startCall(data);
|
|
65
99
|
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Starts a call using a unique identifier (UUID).
|
|
103
|
+
* @param {any} data - Call data including the UUID.
|
|
104
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the call starts successfully.
|
|
105
|
+
*/
|
|
66
106
|
function startCallWithUuid(data) {
|
|
67
107
|
return OmikitPlugin.startCallWithUuid(data);
|
|
68
108
|
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Joins an ongoing call.
|
|
112
|
+
* @returns {Promise<any>} A promise that resolves when the user successfully joins the call.
|
|
113
|
+
*/
|
|
69
114
|
function joinCall() {
|
|
70
115
|
return OmikitPlugin.joinCall();
|
|
71
116
|
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Ends the current call.
|
|
120
|
+
* @returns {Promise<any>} A promise that resolves when the call ends successfully.
|
|
121
|
+
*/
|
|
72
122
|
function endCall() {
|
|
73
123
|
return OmikitPlugin.endCall();
|
|
74
124
|
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Toggles the mute status of the microphone.
|
|
128
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the microphone is muted, `false` otherwise.
|
|
129
|
+
*/
|
|
75
130
|
function toggleMute() {
|
|
76
131
|
return OmikitPlugin.toggleMute();
|
|
77
132
|
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Toggles the speaker status.
|
|
136
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the speaker is enabled, `false` otherwise.
|
|
137
|
+
*/
|
|
78
138
|
function toggleSpeaker() {
|
|
79
139
|
return OmikitPlugin.toggleSpeaker();
|
|
80
140
|
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Places the call on hold or resumes it.
|
|
144
|
+
* @param {any} data - Data related to the hold action.
|
|
145
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the action succeeds.
|
|
146
|
+
*/
|
|
81
147
|
function onHold(data) {
|
|
82
148
|
return OmikitPlugin.onHold(data);
|
|
83
149
|
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Sends DTMF tones during a call.
|
|
153
|
+
* @param {any} data - DTMF tones to be sent.
|
|
154
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the tones are sent successfully.
|
|
155
|
+
*/
|
|
84
156
|
function sendDTMF(data) {
|
|
85
157
|
return OmikitPlugin.sendDTMF(data);
|
|
86
158
|
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Switches the camera during a video call.
|
|
162
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the camera switches successfully.
|
|
163
|
+
*/
|
|
87
164
|
function switchOmiCamera() {
|
|
88
165
|
return OmikitPlugin.switchOmiCamera();
|
|
89
166
|
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Toggles the video stream on or off during a video call.
|
|
170
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the video is toggled successfully.
|
|
171
|
+
*/
|
|
90
172
|
function toggleOmiVideo() {
|
|
91
173
|
return OmikitPlugin.toggleOmiVideo();
|
|
92
174
|
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Logs the user out of the Omikit services.
|
|
178
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if logout is successful.
|
|
179
|
+
*/
|
|
93
180
|
function logout() {
|
|
94
181
|
return OmikitPlugin.logout();
|
|
95
182
|
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Registers for video call events.
|
|
186
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if registration is successful.
|
|
187
|
+
*/
|
|
96
188
|
function registerVideoEvent() {
|
|
97
189
|
return OmikitPlugin.registerVideoEvent();
|
|
98
190
|
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Removes video call event listeners.
|
|
194
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the removal is successful.
|
|
195
|
+
*/
|
|
99
196
|
function removeVideoEvent() {
|
|
100
197
|
return OmikitPlugin.removeVideoEvent();
|
|
101
198
|
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Retrieves the current user's details.
|
|
202
|
+
* @returns {Promise<any>} A promise containing the current user's details.
|
|
203
|
+
*/
|
|
102
204
|
function getCurrentUser() {
|
|
103
205
|
return OmikitPlugin.getCurrentUser();
|
|
104
206
|
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Retrieves guest user details.
|
|
210
|
+
* @returns {Promise<any>} A promise containing the guest user's details.
|
|
211
|
+
*/
|
|
105
212
|
function getGuestUser() {
|
|
106
213
|
return OmikitPlugin.getGuestUser();
|
|
107
214
|
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Requests system alert window permissions.
|
|
218
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the permissions are granted.
|
|
219
|
+
*/
|
|
108
220
|
function systemAlertWindow() {
|
|
109
221
|
return OmikitPlugin.systemAlertWindow();
|
|
110
222
|
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Opens the system alert settings page.
|
|
226
|
+
* @returns {Promise<void>} A promise that resolves when the settings page is opened.
|
|
227
|
+
*/
|
|
111
228
|
function openSystemAlertSetting() {
|
|
112
229
|
return OmikitPlugin.openSystemAlertSetting();
|
|
113
230
|
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Retrieves available audio devices.
|
|
234
|
+
* @returns {Promise<any>} A promise containing the list of audio devices.
|
|
235
|
+
*/
|
|
114
236
|
function getAudio() {
|
|
115
237
|
return OmikitPlugin.getAudio();
|
|
116
238
|
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Sets the audio device to be used during a call.
|
|
242
|
+
* @param {any} data - Data related to the audio device.
|
|
243
|
+
* @returns {Promise<void>} A promise that resolves when the audio device is set.
|
|
244
|
+
*/
|
|
117
245
|
function setAudio(data) {
|
|
118
246
|
return OmikitPlugin.setAudio(data);
|
|
119
247
|
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Retrieves the currently active audio device.
|
|
251
|
+
* @returns {Promise<any>} A promise containing the current audio device details.
|
|
252
|
+
*/
|
|
120
253
|
function getCurrentAudio() {
|
|
121
254
|
return OmikitPlugin.getCurrentAudio();
|
|
122
255
|
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Transfers the call to another user or device.
|
|
259
|
+
* @param {any} data - Data related to the call transfer.
|
|
260
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the transfer is successful.
|
|
261
|
+
*/
|
|
123
262
|
function transferCall(data) {
|
|
124
263
|
return OmikitPlugin.transferCall(data);
|
|
125
264
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","OmikitPlugin","NativeModules","Proxy","get","Error","startServices","configPushNotification","data","getInitialCall","OS","initCallWithUserPassword","initCallWithApiKey","startCall","startCallWithUuid","joinCall","endCall","toggleMute","toggleSpeaker","onHold","sendDTMF","switchOmiCamera","toggleOmiVideo","logout","registerVideoEvent","removeVideoEvent","getCurrentUser","getGuestUser","systemAlertWindow","openSystemAlertSetting","getAudio","setAudio","getCurrentAudio","transferCall","omiEmitter","NativeEventEmitter","exports","OmiCallEvent","onCallStateChanged","onSpeaker","onMuted","onRemoteVideoReady","onClickMissedCall","onSwitchboardAnswer","onCallQuality","onAudioChange"],"sourceRoot":"../../src","sources":["omikit.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,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,MAAMC,YAAY,GAAGC,0BAAa,CAACD,YAAY,GAC3CC,0BAAa,CAACD,YAAY,GAC1B,IAAIE,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACT,aAAa,CAAC;EAChC;AACF,CAAC,CACF;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","OmikitPlugin","NativeModules","Proxy","get","Error","startServices","configPushNotification","data","getInitialCall","OS","initCallWithUserPassword","initCallWithApiKey","startCall","startCallWithUuid","joinCall","endCall","toggleMute","toggleSpeaker","onHold","sendDTMF","switchOmiCamera","toggleOmiVideo","logout","registerVideoEvent","removeVideoEvent","getCurrentUser","getGuestUser","systemAlertWindow","openSystemAlertSetting","getAudio","setAudio","getCurrentAudio","transferCall","omiEmitter","NativeEventEmitter","exports","OmiCallEvent","onCallStateChanged","onSpeaker","onMuted","onRemoteVideoReady","onClickMissedCall","onSwitchboardAnswer","onCallQuality","onAudioChange"],"sourceRoot":"../../src","sources":["omikit.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,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,MAAMC,YAAY,GAAGC,0BAAa,CAACD,YAAY,GAC3CC,0BAAa,CAACD,YAAY,GAC1B,IAAIE,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACT,aAAa,CAAC;EAChC;AACF,CAAC,CACF;;AAEL;AACA;AACA;AACA;AACO,SAASU,aAAaA,CAAA,EAAiB;EAC5C,OAAOL,YAAY,CAACK,aAAa,EAAE;AACrC;;AAGA;AACA;AACA;AACA;AACA;AACO,SAASC,sBAAsBA,CAACC,IAAS,EAAgB;EAC9D,OAAOP,YAAY,CAACM,sBAAsB,CAACC,IAAI,CAAC;AAClD;;AAEA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAA,EAAiB;EAC7C,IAAGZ,qBAAQ,CAACa,EAAE,IAAI,KAAK,EAAC;IACxB,OAAOT,YAAY,CAACQ,cAAc,EAAE;EACpC,CAAC,MAAM;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A;AACO,SAASC,YAAYA,CAACzB,IAAS,EAAoB;EACxD,OAAOP,YAAY,CAACgC,YAAY,CAACzB,IAAI,CAAC;AACxC;AAEO,MAAM0B,UAAU,GAAG,IAAIC,+BAAkB,CAAClC,YAAY,CAAC;AAACmC,OAAA,CAAAF,UAAA,GAAAA,UAAA;AAExD,MAAMG,YAAY,GAAG;EAC1BC,kBAAkB,EAAE,oBAAoB;EACxCC,SAAS,EAAE,SAAS;EACpBC,OAAO,EAAE,OAAO;EAChBC,kBAAkB,EAAE,oBAAoB;EACxCC,iBAAiB,EAAE,mBAAmB;EACtCC,mBAAmB,EAAE,oBAAoB;EACzCC,aAAa,EAAE,cAAc;EAC7BC,aAAa,EAAE;AACjB,CAAC;AAACT,OAAA,CAAAC,YAAA,GAAAA,YAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["omikit-plugin.d.ts"],"mappings":""}
|
package/lib/module/omikit.js
CHANGED
|
@@ -8,12 +8,28 @@ const OmikitPlugin = NativeModules.OmikitPlugin ? NativeModules.OmikitPlugin : n
|
|
|
8
8
|
throw new Error(LINKING_ERROR);
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Starts the Omikit services.
|
|
14
|
+
* @returns {Promise<any>} A promise that resolves when the services start successfully.
|
|
15
|
+
*/
|
|
11
16
|
export function startServices() {
|
|
12
17
|
return OmikitPlugin.startServices();
|
|
13
18
|
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Configures push notifications with the given data.
|
|
22
|
+
* @param {any} data - Configuration data for push notifications.
|
|
23
|
+
* @returns {Promise<any>} A promise that resolves when the configuration is complete.
|
|
24
|
+
*/
|
|
14
25
|
export function configPushNotification(data) {
|
|
15
26
|
return OmikitPlugin.configPushNotification(data);
|
|
16
27
|
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves the initial call details when start call
|
|
31
|
+
* @returns {Promise<any>} A promise containing the initial call details.
|
|
32
|
+
*/
|
|
17
33
|
export function getInitialCall() {
|
|
18
34
|
if (Platform.OS == "ios") {
|
|
19
35
|
return OmikitPlugin.getInitialCall();
|
|
@@ -21,72 +37,195 @@ export function getInitialCall() {
|
|
|
21
37
|
return OmikitPlugin.getInitialCall(4);
|
|
22
38
|
}
|
|
23
39
|
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Login into OMICALL with a username and password.
|
|
43
|
+
* @param {any} data - User credentials for initialization.
|
|
44
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if initialization is successful.
|
|
45
|
+
*/
|
|
24
46
|
export function initCallWithUserPassword(data) {
|
|
25
47
|
return OmikitPlugin.initCallWithUserPassword(data);
|
|
26
48
|
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Login into OMICALL with using an API key.
|
|
52
|
+
* @param {any} data - API key and related data.
|
|
53
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if initialization is successful.
|
|
54
|
+
*/
|
|
27
55
|
export function initCallWithApiKey(data) {
|
|
28
56
|
return OmikitPlugin.initCallWithApiKey(data);
|
|
29
57
|
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Starts a new call with the given data.
|
|
61
|
+
* @param {any} data - Call configuration data.
|
|
62
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the call starts successfully.
|
|
63
|
+
*/
|
|
30
64
|
export function startCall(data) {
|
|
31
65
|
return OmikitPlugin.startCall(data);
|
|
32
66
|
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Starts a call using a unique identifier (UUID).
|
|
70
|
+
* @param {any} data - Call data including the UUID.
|
|
71
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the call starts successfully.
|
|
72
|
+
*/
|
|
33
73
|
export function startCallWithUuid(data) {
|
|
34
74
|
return OmikitPlugin.startCallWithUuid(data);
|
|
35
75
|
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Joins an ongoing call.
|
|
79
|
+
* @returns {Promise<any>} A promise that resolves when the user successfully joins the call.
|
|
80
|
+
*/
|
|
36
81
|
export function joinCall() {
|
|
37
82
|
return OmikitPlugin.joinCall();
|
|
38
83
|
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Ends the current call.
|
|
87
|
+
* @returns {Promise<any>} A promise that resolves when the call ends successfully.
|
|
88
|
+
*/
|
|
39
89
|
export function endCall() {
|
|
40
90
|
return OmikitPlugin.endCall();
|
|
41
91
|
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Toggles the mute status of the microphone.
|
|
95
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the microphone is muted, `false` otherwise.
|
|
96
|
+
*/
|
|
42
97
|
export function toggleMute() {
|
|
43
98
|
return OmikitPlugin.toggleMute();
|
|
44
99
|
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Toggles the speaker status.
|
|
103
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the speaker is enabled, `false` otherwise.
|
|
104
|
+
*/
|
|
45
105
|
export function toggleSpeaker() {
|
|
46
106
|
return OmikitPlugin.toggleSpeaker();
|
|
47
107
|
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Places the call on hold or resumes it.
|
|
111
|
+
* @param {any} data - Data related to the hold action.
|
|
112
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the action succeeds.
|
|
113
|
+
*/
|
|
48
114
|
export function onHold(data) {
|
|
49
115
|
return OmikitPlugin.onHold(data);
|
|
50
116
|
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Sends DTMF tones during a call.
|
|
120
|
+
* @param {any} data - DTMF tones to be sent.
|
|
121
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the tones are sent successfully.
|
|
122
|
+
*/
|
|
51
123
|
export function sendDTMF(data) {
|
|
52
124
|
return OmikitPlugin.sendDTMF(data);
|
|
53
125
|
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Switches the camera during a video call.
|
|
129
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the camera switches successfully.
|
|
130
|
+
*/
|
|
54
131
|
export function switchOmiCamera() {
|
|
55
132
|
return OmikitPlugin.switchOmiCamera();
|
|
56
133
|
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Toggles the video stream on or off during a video call.
|
|
137
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the video is toggled successfully.
|
|
138
|
+
*/
|
|
57
139
|
export function toggleOmiVideo() {
|
|
58
140
|
return OmikitPlugin.toggleOmiVideo();
|
|
59
141
|
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Logs the user out of the Omikit services.
|
|
145
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if logout is successful.
|
|
146
|
+
*/
|
|
60
147
|
export function logout() {
|
|
61
148
|
return OmikitPlugin.logout();
|
|
62
149
|
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Registers for video call events.
|
|
153
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if registration is successful.
|
|
154
|
+
*/
|
|
63
155
|
export function registerVideoEvent() {
|
|
64
156
|
return OmikitPlugin.registerVideoEvent();
|
|
65
157
|
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Removes video call event listeners.
|
|
161
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the removal is successful.
|
|
162
|
+
*/
|
|
66
163
|
export function removeVideoEvent() {
|
|
67
164
|
return OmikitPlugin.removeVideoEvent();
|
|
68
165
|
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Retrieves the current user's details.
|
|
169
|
+
* @returns {Promise<any>} A promise containing the current user's details.
|
|
170
|
+
*/
|
|
69
171
|
export function getCurrentUser() {
|
|
70
172
|
return OmikitPlugin.getCurrentUser();
|
|
71
173
|
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Retrieves guest user details.
|
|
177
|
+
* @returns {Promise<any>} A promise containing the guest user's details.
|
|
178
|
+
*/
|
|
72
179
|
export function getGuestUser() {
|
|
73
180
|
return OmikitPlugin.getGuestUser();
|
|
74
181
|
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Requests system alert window permissions.
|
|
185
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the permissions are granted.
|
|
186
|
+
*/
|
|
75
187
|
export function systemAlertWindow() {
|
|
76
188
|
return OmikitPlugin.systemAlertWindow();
|
|
77
189
|
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Opens the system alert settings page.
|
|
193
|
+
* @returns {Promise<void>} A promise that resolves when the settings page is opened.
|
|
194
|
+
*/
|
|
78
195
|
export function openSystemAlertSetting() {
|
|
79
196
|
return OmikitPlugin.openSystemAlertSetting();
|
|
80
197
|
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Retrieves available audio devices.
|
|
201
|
+
* @returns {Promise<any>} A promise containing the list of audio devices.
|
|
202
|
+
*/
|
|
81
203
|
export function getAudio() {
|
|
82
204
|
return OmikitPlugin.getAudio();
|
|
83
205
|
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Sets the audio device to be used during a call.
|
|
209
|
+
* @param {any} data - Data related to the audio device.
|
|
210
|
+
* @returns {Promise<void>} A promise that resolves when the audio device is set.
|
|
211
|
+
*/
|
|
84
212
|
export function setAudio(data) {
|
|
85
213
|
return OmikitPlugin.setAudio(data);
|
|
86
214
|
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Retrieves the currently active audio device.
|
|
218
|
+
* @returns {Promise<any>} A promise containing the current audio device details.
|
|
219
|
+
*/
|
|
87
220
|
export function getCurrentAudio() {
|
|
88
221
|
return OmikitPlugin.getCurrentAudio();
|
|
89
222
|
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Transfers the call to another user or device.
|
|
226
|
+
* @param {any} data - Data related to the call transfer.
|
|
227
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the transfer is successful.
|
|
228
|
+
*/
|
|
90
229
|
export function transferCall(data) {
|
|
91
230
|
return OmikitPlugin.transferCall(data);
|
|
92
231
|
}
|
package/lib/module/omikit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","NativeEventEmitter","LINKING_ERROR","select","ios","default","OmikitPlugin","Proxy","get","Error","startServices","configPushNotification","data","getInitialCall","OS","initCallWithUserPassword","initCallWithApiKey","startCall","startCallWithUuid","joinCall","endCall","toggleMute","toggleSpeaker","onHold","sendDTMF","switchOmiCamera","toggleOmiVideo","logout","registerVideoEvent","removeVideoEvent","getCurrentUser","getGuestUser","systemAlertWindow","openSystemAlertSetting","getAudio","setAudio","getCurrentAudio","transferCall","omiEmitter","OmiCallEvent","onCallStateChanged","onSpeaker","onMuted","onRemoteVideoReady","onClickMissedCall","onSwitchboardAnswer","onCallQuality","onAudioChange"],"sourceRoot":"../../src","sources":["omikit.tsx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,EAAEC,kBAAkB,QAAQ,cAAc;AAE1E,MAAMC,aAAa,GAChB,wEAAuE,GACxEF,QAAQ,CAACG,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,YAAY,GAAGP,aAAa,CAACO,YAAY,GAC3CP,aAAa,CAACO,YAAY,GAC1B,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CAAC,CACF;
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","NativeEventEmitter","LINKING_ERROR","select","ios","default","OmikitPlugin","Proxy","get","Error","startServices","configPushNotification","data","getInitialCall","OS","initCallWithUserPassword","initCallWithApiKey","startCall","startCallWithUuid","joinCall","endCall","toggleMute","toggleSpeaker","onHold","sendDTMF","switchOmiCamera","toggleOmiVideo","logout","registerVideoEvent","removeVideoEvent","getCurrentUser","getGuestUser","systemAlertWindow","openSystemAlertSetting","getAudio","setAudio","getCurrentAudio","transferCall","omiEmitter","OmiCallEvent","onCallStateChanged","onSpeaker","onMuted","onRemoteVideoReady","onClickMissedCall","onSwitchboardAnswer","onCallQuality","onAudioChange"],"sourceRoot":"../../src","sources":["omikit.tsx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,EAAEC,kBAAkB,QAAQ,cAAc;AAE1E,MAAMC,aAAa,GAChB,wEAAuE,GACxEF,QAAQ,CAACG,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,YAAY,GAAGP,aAAa,CAACO,YAAY,GAC3CP,aAAa,CAACO,YAAY,GAC1B,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CAAC,CACF;;AAEL;AACA;AACA;AACA;AACA,OAAO,SAASQ,aAAaA,CAAA,EAAiB;EAC5C,OAAOJ,YAAY,CAACI,aAAa,EAAE;AACrC;;AAGA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAACC,IAAS,EAAgB;EAC9D,OAAON,YAAY,CAACK,sBAAsB,CAACC,IAAI,CAAC;AAClD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAiB;EAC7C,IAAGb,QAAQ,CAACc,EAAE,IAAI,KAAK,EAAC;IACxB,OAAOR,YAAY,CAACO,cAAc,EAAE;EACpC,CAAC,MAAM;IACL,OAAOP,YAAY,CAACO,cAAc,CAAC,CAAC,CAAC;EACvC;AACF;;AAEA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AY,CAAC8B,eAAe,EAAE;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAACzB,IAAS,EAAoB;EACxD,OAAON,YAAY,CAAC+B,YAAY,CAACzB,IAAI,CAAC;AACxC;AAEA,OAAO,MAAM0B,UAAU,GAAG,IAAIrC,kBAAkB,CAACK,YAAY,CAAC;AAE9D,OAAO,MAAMiC,YAAY,GAAG;EAC1BC,kBAAkB,EAAE,oBAAoB;EACxCC,SAAS,EAAE,SAAS;EACpBC,OAAO,EAAE,OAAO;EAChBC,kBAAkB,EAAE,oBAAoB;EACxCC,iBAAiB,EAAE,mBAAmB;EACtCC,mBAAmB,EAAE,oBAAoB;EACzCC,aAAa,EAAE,cAAc;EAC7BC,aAAa,EAAE;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["omikit-plugin.d.ts"],"mappings":""}
|
package/package.json
CHANGED
package/src/omikit.tsx
CHANGED
|
@@ -17,14 +17,28 @@ const OmikitPlugin = NativeModules.OmikitPlugin
|
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Starts the Omikit services.
|
|
22
|
+
* @returns {Promise<any>} A promise that resolves when the services start successfully.
|
|
23
|
+
*/
|
|
20
24
|
export function startServices(): Promise<any> {
|
|
21
25
|
return OmikitPlugin.startServices();
|
|
22
26
|
}
|
|
23
27
|
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Configures push notifications with the given data.
|
|
31
|
+
* @param {any} data - Configuration data for push notifications.
|
|
32
|
+
* @returns {Promise<any>} A promise that resolves when the configuration is complete.
|
|
33
|
+
*/
|
|
24
34
|
export function configPushNotification(data: any): Promise<any> {
|
|
25
35
|
return OmikitPlugin.configPushNotification(data);
|
|
26
36
|
}
|
|
27
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves the initial call details when start call
|
|
40
|
+
* @returns {Promise<any>} A promise containing the initial call details.
|
|
41
|
+
*/
|
|
28
42
|
export function getInitialCall(): Promise<any> {
|
|
29
43
|
if(Platform.OS == "ios"){
|
|
30
44
|
return OmikitPlugin.getInitialCall();
|
|
@@ -33,95 +47,200 @@ export function getInitialCall(): Promise<any> {
|
|
|
33
47
|
}
|
|
34
48
|
}
|
|
35
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Login into OMICALL with a username and password.
|
|
52
|
+
* @param {any} data - User credentials for initialization.
|
|
53
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if initialization is successful.
|
|
54
|
+
*/
|
|
36
55
|
export function initCallWithUserPassword(data: any): Promise<boolean> {
|
|
37
56
|
return OmikitPlugin.initCallWithUserPassword(data);
|
|
38
57
|
}
|
|
39
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Login into OMICALL with using an API key.
|
|
61
|
+
* @param {any} data - API key and related data.
|
|
62
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if initialization is successful.
|
|
63
|
+
*/
|
|
40
64
|
export function initCallWithApiKey(data: any): Promise<boolean> {
|
|
41
65
|
return OmikitPlugin.initCallWithApiKey(data);
|
|
42
66
|
}
|
|
43
67
|
|
|
44
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Starts a new call with the given data.
|
|
70
|
+
* @param {any} data - Call configuration data.
|
|
71
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the call starts successfully.
|
|
72
|
+
*/
|
|
45
73
|
export function startCall(data: any): Promise<boolean> {
|
|
46
74
|
return OmikitPlugin.startCall(data);
|
|
47
75
|
}
|
|
48
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Starts a call using a unique identifier (UUID).
|
|
79
|
+
* @param {any} data - Call data including the UUID.
|
|
80
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the call starts successfully.
|
|
81
|
+
*/
|
|
49
82
|
export function startCallWithUuid(data: any): Promise<boolean> {
|
|
50
83
|
return OmikitPlugin.startCallWithUuid(data);
|
|
51
84
|
}
|
|
52
85
|
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Joins an ongoing call.
|
|
89
|
+
* @returns {Promise<any>} A promise that resolves when the user successfully joins the call.
|
|
90
|
+
*/
|
|
53
91
|
export function joinCall(): Promise<any> {
|
|
54
92
|
return OmikitPlugin.joinCall();
|
|
55
93
|
}
|
|
56
94
|
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Ends the current call.
|
|
98
|
+
* @returns {Promise<any>} A promise that resolves when the call ends successfully.
|
|
99
|
+
*/
|
|
57
100
|
export function endCall(): Promise<any> {
|
|
58
101
|
return OmikitPlugin.endCall();
|
|
59
102
|
}
|
|
60
103
|
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Toggles the mute status of the microphone.
|
|
107
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the microphone is muted, `false` otherwise.
|
|
108
|
+
*/
|
|
61
109
|
export function toggleMute(): Promise<boolean> {
|
|
62
110
|
return OmikitPlugin.toggleMute();
|
|
63
111
|
}
|
|
64
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Toggles the speaker status.
|
|
115
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the speaker is enabled, `false` otherwise.
|
|
116
|
+
*/
|
|
65
117
|
export function toggleSpeaker(): Promise<boolean> {
|
|
66
118
|
return OmikitPlugin.toggleSpeaker();
|
|
67
119
|
}
|
|
68
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Places the call on hold or resumes it.
|
|
123
|
+
* @param {any} data - Data related to the hold action.
|
|
124
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the action succeeds.
|
|
125
|
+
*/
|
|
69
126
|
export function onHold(data: any): Promise<boolean> {
|
|
70
127
|
return OmikitPlugin.onHold(data);
|
|
71
128
|
}
|
|
72
129
|
|
|
130
|
+
/**
|
|
131
|
+
* Sends DTMF tones during a call.
|
|
132
|
+
* @param {any} data - DTMF tones to be sent.
|
|
133
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the tones are sent successfully.
|
|
134
|
+
*/
|
|
73
135
|
export function sendDTMF(data: any): Promise<boolean> {
|
|
74
136
|
return OmikitPlugin.sendDTMF(data);
|
|
75
137
|
}
|
|
76
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Switches the camera during a video call.
|
|
141
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the camera switches successfully.
|
|
142
|
+
*/
|
|
77
143
|
export function switchOmiCamera(): Promise<boolean> {
|
|
78
144
|
return OmikitPlugin.switchOmiCamera();
|
|
79
145
|
}
|
|
80
146
|
|
|
147
|
+
/**
|
|
148
|
+
* Toggles the video stream on or off during a video call.
|
|
149
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the video is toggled successfully.
|
|
150
|
+
*/
|
|
81
151
|
export function toggleOmiVideo(): Promise<boolean> {
|
|
82
152
|
return OmikitPlugin.toggleOmiVideo();
|
|
83
153
|
}
|
|
84
154
|
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Logs the user out of the Omikit services.
|
|
158
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if logout is successful.
|
|
159
|
+
*/
|
|
85
160
|
export function logout(): Promise<boolean> {
|
|
86
161
|
return OmikitPlugin.logout();
|
|
87
162
|
}
|
|
88
163
|
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Registers for video call events.
|
|
167
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if registration is successful.
|
|
168
|
+
*/
|
|
89
169
|
export function registerVideoEvent(): Promise<boolean> {
|
|
90
170
|
return OmikitPlugin.registerVideoEvent();
|
|
91
171
|
}
|
|
92
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Removes video call event listeners.
|
|
175
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the removal is successful.
|
|
176
|
+
*/
|
|
93
177
|
export function removeVideoEvent(): Promise<boolean> {
|
|
94
178
|
return OmikitPlugin.removeVideoEvent();
|
|
95
179
|
}
|
|
96
180
|
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Retrieves the current user's details.
|
|
184
|
+
* @returns {Promise<any>} A promise containing the current user's details.
|
|
185
|
+
*/
|
|
97
186
|
export function getCurrentUser(): Promise<any> {
|
|
98
187
|
return OmikitPlugin.getCurrentUser();
|
|
99
188
|
}
|
|
100
189
|
|
|
190
|
+
/**
|
|
191
|
+
* Retrieves guest user details.
|
|
192
|
+
* @returns {Promise<any>} A promise containing the guest user's details.
|
|
193
|
+
*/
|
|
101
194
|
export function getGuestUser(): Promise<any> {
|
|
102
195
|
return OmikitPlugin.getGuestUser();
|
|
103
196
|
}
|
|
104
197
|
|
|
198
|
+
/**
|
|
199
|
+
* Requests system alert window permissions.
|
|
200
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the permissions are granted.
|
|
201
|
+
*/
|
|
105
202
|
export function systemAlertWindow(): Promise<boolean> {
|
|
106
203
|
return OmikitPlugin.systemAlertWindow();
|
|
107
204
|
}
|
|
108
205
|
|
|
206
|
+
/**
|
|
207
|
+
* Opens the system alert settings page.
|
|
208
|
+
* @returns {Promise<void>} A promise that resolves when the settings page is opened.
|
|
209
|
+
*/
|
|
109
210
|
export function openSystemAlertSetting(): Promise<void> {
|
|
110
211
|
return OmikitPlugin.openSystemAlertSetting();
|
|
111
212
|
}
|
|
112
213
|
|
|
214
|
+
/**
|
|
215
|
+
* Retrieves available audio devices.
|
|
216
|
+
* @returns {Promise<any>} A promise containing the list of audio devices.
|
|
217
|
+
*/
|
|
113
218
|
export function getAudio(): Promise<any> {
|
|
114
219
|
return OmikitPlugin.getAudio();
|
|
115
220
|
}
|
|
116
221
|
|
|
222
|
+
/**
|
|
223
|
+
* Sets the audio device to be used during a call.
|
|
224
|
+
* @param {any} data - Data related to the audio device.
|
|
225
|
+
* @returns {Promise<void>} A promise that resolves when the audio device is set.
|
|
226
|
+
*/
|
|
117
227
|
export function setAudio(data: any): Promise<void> {
|
|
118
228
|
return OmikitPlugin.setAudio(data);
|
|
119
229
|
}
|
|
120
230
|
|
|
231
|
+
/**
|
|
232
|
+
* Retrieves the currently active audio device.
|
|
233
|
+
* @returns {Promise<any>} A promise containing the current audio device details.
|
|
234
|
+
*/
|
|
121
235
|
export function getCurrentAudio(): Promise<any> {
|
|
122
236
|
return OmikitPlugin.getCurrentAudio();
|
|
123
237
|
}
|
|
124
238
|
|
|
239
|
+
/**
|
|
240
|
+
* Transfers the call to another user or device.
|
|
241
|
+
* @param {any} data - Data related to the call transfer.
|
|
242
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the transfer is successful.
|
|
243
|
+
*/
|
|
125
244
|
export function transferCall(data: any): Promise<boolean> {
|
|
126
245
|
return OmikitPlugin.transferCall(data);
|
|
127
246
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare module 'omikit-plugin' {
|
|
2
|
+
import { NativeEventEmitter } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export function startServices(): Promise<any>;
|
|
5
|
+
export function configPushNotification(data: any): Promise<any>;
|
|
6
|
+
export function getInitialCall(): Promise<any>;
|
|
7
|
+
export function initCallWithUserPassword(data: any): Promise<boolean>;
|
|
8
|
+
export function initCallWithApiKey(data: any): Promise<boolean>;
|
|
9
|
+
export function startCall(data: any): Promise<boolean>;
|
|
10
|
+
export function startCallWithUuid(data: any): Promise<boolean>;
|
|
11
|
+
export function joinCall(): Promise<any>;
|
|
12
|
+
export function endCall(): Promise<any>;
|
|
13
|
+
export function toggleMute(): Promise<boolean>;
|
|
14
|
+
export function toggleSpeaker(): Promise<boolean>;
|
|
15
|
+
export function onHold(data: any): Promise<boolean>;
|
|
16
|
+
export function sendDTMF(data: any): Promise<boolean>;
|
|
17
|
+
export function switchOmiCamera(): Promise<boolean>;
|
|
18
|
+
export function toggleOmiVideo(): Promise<boolean>;
|
|
19
|
+
export function logout(): Promise<boolean>;
|
|
20
|
+
export function registerVideoEvent(): Promise<boolean>;
|
|
21
|
+
export function removeVideoEvent(): Promise<boolean>;
|
|
22
|
+
export function getCurrentUser(): Promise<any>;
|
|
23
|
+
export function getGuestUser(): Promise<any>;
|
|
24
|
+
export function systemAlertWindow(): Promise<boolean>;
|
|
25
|
+
export function openSystemAlertSetting(): Promise<void>;
|
|
26
|
+
export function getAudio(): Promise<any>;
|
|
27
|
+
export function setAudio(data: any): Promise<void>;
|
|
28
|
+
export function getCurrentAudio(): Promise<any>;
|
|
29
|
+
export function transferCall(data: any): Promise<boolean>;
|
|
30
|
+
|
|
31
|
+
export const omiEmitter: NativeEventEmitter;
|
|
32
|
+
|
|
33
|
+
export const OmiCallEvent: {
|
|
34
|
+
onCallStateChanged: string;
|
|
35
|
+
onSpeaker: string;
|
|
36
|
+
onMuted: string;
|
|
37
|
+
onRemoteVideoReady: string;
|
|
38
|
+
onClickMissedCall: string;
|
|
39
|
+
onSwitchboardAnswer: string;
|
|
40
|
+
onCallQuality: string;
|
|
41
|
+
onAudioChange: string;
|
|
42
|
+
};
|
|
43
|
+
}
|