omikit-plugin 2.3.0 → 2.3.1
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/android/build.gradle
CHANGED
|
@@ -96,7 +96,7 @@ dependencies {
|
|
|
96
96
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
97
97
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
98
98
|
|
|
99
|
-
api 'vn.vihat.omicall:omi-sdk:1.2.
|
|
99
|
+
api 'vn.vihat.omicall:omi-sdk:1.2.15'
|
|
100
100
|
|
|
101
101
|
implementation 'androidx.core:core-ktx:1.7.0'
|
|
102
102
|
implementation 'androidx.fragment:fragment-ktx:1.4.0'
|
|
@@ -2,10 +2,8 @@ package com.omikitplugin
|
|
|
2
2
|
|
|
3
3
|
import android.Manifest
|
|
4
4
|
import android.app.Activity
|
|
5
|
-
import android.content.Context
|
|
6
5
|
import android.content.Intent
|
|
7
6
|
import android.content.pm.PackageManager
|
|
8
|
-
import android.hardware.camera2.CameraManager
|
|
9
7
|
import android.os.Build
|
|
10
8
|
import android.os.Handler
|
|
11
9
|
import android.os.Looper
|
|
@@ -134,10 +132,6 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
134
132
|
OmiClient(context = reactApplicationContext!!)
|
|
135
133
|
OmiClient.instance.setListener(callListener)
|
|
136
134
|
OmiClient.instance.addAccountListener(accountListener)
|
|
137
|
-
val needSetupVideo = OmiClient.instance.needSetupCamera()
|
|
138
|
-
if (needSetupVideo) {
|
|
139
|
-
setCamera()
|
|
140
|
-
}
|
|
141
135
|
promise.resolve(true)
|
|
142
136
|
}
|
|
143
137
|
|
|
@@ -185,9 +179,6 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
185
179
|
)
|
|
186
180
|
}
|
|
187
181
|
requestPermission(isVideo)
|
|
188
|
-
if (isVideo) {
|
|
189
|
-
setCamera()
|
|
190
|
-
}
|
|
191
182
|
promise.resolve(true)
|
|
192
183
|
}
|
|
193
184
|
}
|
|
@@ -215,9 +206,6 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
215
206
|
}
|
|
216
207
|
}
|
|
217
208
|
requestPermission(isVideo)
|
|
218
|
-
if (isVideo) {
|
|
219
|
-
setCamera()
|
|
220
|
-
}
|
|
221
209
|
promise.resolve(loginResult)
|
|
222
210
|
}
|
|
223
211
|
}
|
|
@@ -545,12 +533,6 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
545
533
|
)
|
|
546
534
|
}
|
|
547
535
|
|
|
548
|
-
private fun setCamera() {
|
|
549
|
-
val cm =
|
|
550
|
-
reactApplicationContext!!.getSystemService(Context.CAMERA_SERVICE) as CameraManager
|
|
551
|
-
OmiClient.instance.setCameraManager(cm)
|
|
552
|
-
}
|
|
553
|
-
|
|
554
536
|
override fun onActivityResult(p0: Activity?, p1: Int, p2: Int, p3: Intent?) {
|
|
555
537
|
|
|
556
538
|
}
|