omikit-plugin 3.2.9 → 3.2.11

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.
@@ -104,7 +104,7 @@ dependencies {
104
104
  // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
105
105
  //noinspection GradleDynamicVersion
106
106
  // implementation "com.facebook.react:react-native"
107
- api 'vn.vihat.omicall:omi-sdk:2.0.60'
107
+ api 'vn.vihat.omicall:omi-sdk:2.0.63'
108
108
 
109
109
  implementation "com.facebook.react:react-native:+" // From node_modules
110
110
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
@@ -288,6 +288,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
288
288
  @ReactMethod
289
289
  fun initCallWithUserPassword(data: ReadableMap, promise: Promise) {
290
290
  mainScope.launch {
291
+ var loginResult = false
291
292
  val userName = data.getString("userName")
292
293
  Log.d("dataOmi", "INIT_CALL_USER_PASSWORD ==>> $data ")
293
294
  Log.d("dataOmi", "INIT_CALL_USER_PASSWORD ==>> $userName ")
@@ -301,13 +302,15 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
301
302
 
302
303
  withContext(Dispatchers.Default) {
303
304
  try {
304
- if (userName != null && password != null && realm != null) {
305
- OmiClient.register(userName, password, realm , isVideo ?: true, firebaseToken, host)
305
+ if (userName != null && password != null && realm != null && firebaseToken != null) {
306
+ loginResult = OmiClient.register(userName, password, realm , isVideo ?: true, firebaseToken, host)
307
+ promise.resolve(loginResult)
306
308
  }
307
309
  } catch (_: Throwable) {
310
+ promise.resolve(loginResult)
308
311
  }
309
312
  }
310
- promise.resolve(true)
313
+ promise.resolve(loginResult)
311
314
  }
312
315
  }
313
316
 
@@ -324,7 +327,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
324
327
  requestPermission(isVideo)
325
328
  withContext(Dispatchers.Default) {
326
329
  try {
327
- if (usrName != null && usrUuid != null && apiKey != null) {
330
+ if (usrName != null && usrUuid != null && apiKey != null && firebaseToken != null ) {
328
331
  loginResult = OmiClient.registerWithApiKey(
329
332
  apiKey = apiKey,
330
333
  userName = usrName,
@@ -348,6 +351,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
348
351
  fun getInitialCall(promise: Promise) {
349
352
  currentActivity?.runOnUiThread {
350
353
  val call = OmiClient.getInstance(reactApplicationContext!!).getCurrentCallInfo()
354
+ Log.d("getInitialCall RN", "getInitialCall $call")
351
355
  if (call != null) {
352
356
  val map: WritableMap = WritableNativeMap()
353
357
  map.putString("callerNumber", call["callerNumber"] as String)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omikit-plugin",
3
- "version": "3.2.9",
3
+ "version": "3.2.11",
4
4
  "description": "Omikit Plugin by ViHAT",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",