react-native-gizwits-sdk-v5 1.3.68 → 1.3.70
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
|
@@ -63,10 +63,10 @@ dependencies {
|
|
|
63
63
|
|
|
64
64
|
implementation "androidx.startup:startup-runtime:$startup_version"
|
|
65
65
|
|
|
66
|
-
implementation("io.github.gizwits:sdk:1.0.
|
|
67
|
-
implementation("io.github.gizwits:sdk-bluetooth:1.0.
|
|
68
|
-
implementation("io.github.gizwits:sdk-lan:1.0.
|
|
69
|
-
implementation("io.github.gizwits:sdk-mqtt:1.0.
|
|
66
|
+
implementation("io.github.gizwits:sdk:1.0.55")
|
|
67
|
+
implementation("io.github.gizwits:sdk-bluetooth:1.0.55")
|
|
68
|
+
implementation("io.github.gizwits:sdk-lan:1.0.55")
|
|
69
|
+
implementation("io.github.gizwits:sdk-mqtt:1.0.55")
|
|
70
70
|
|
|
71
71
|
// implementation files('libs/sdk-release.aar', 'libs/sdk-bluetooth-release.aar', 'libs/sdk-lan-release.aar', 'libs/sdk-mqtt-release.aar')
|
|
72
72
|
|
|
@@ -33,6 +33,7 @@ import kotlinx.coroutines.flow.collectLatest
|
|
|
33
33
|
import kotlinx.coroutines.flow.combine
|
|
34
34
|
import kotlinx.coroutines.flow.debounce
|
|
35
35
|
import kotlinx.coroutines.flow.first
|
|
36
|
+
import kotlinx.coroutines.flow.last
|
|
36
37
|
import kotlinx.coroutines.flow.mapLatest
|
|
37
38
|
import kotlinx.coroutines.flow.take
|
|
38
39
|
import kotlinx.coroutines.launch
|
|
@@ -121,7 +122,7 @@ class RNGizSDKManagerModule(reactContext: ReactApplicationContext) : ReactContex
|
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
124
|
CoroutineScope(Dispatchers.IO).launch {
|
|
124
|
-
deviceListState.debounce(500).
|
|
125
|
+
deviceListState.debounce(500).collectLatest { deviceList ->
|
|
125
126
|
val newDevices = deviceList - devices
|
|
126
127
|
devices = deviceList
|
|
127
128
|
newDevices.forEach{dev ->
|
|
@@ -261,13 +262,15 @@ class RNGizSDKManagerModule(reactContext: ReactApplicationContext) : ReactContex
|
|
|
261
262
|
fun initSDK(options: ReadableMap, result: Callback) {
|
|
262
263
|
var config = RNGizParamsChecker.check(options, result, GizConfiguration::class.java)
|
|
263
264
|
config?.let {
|
|
265
|
+
CoroutineScope(Dispatchers.Main).launch {
|
|
264
266
|
try {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
267
|
+
GizSDKManager.setDebug(true)
|
|
268
|
+
GizSDKManager.initSDK(config)
|
|
269
|
+
GizRNCallbackManager.callbackWithResult(callback = result, result = Result.success<Number>(0))
|
|
268
270
|
} catch (e: GizException) {
|
|
269
|
-
|
|
271
|
+
GizRNCallbackManager.callbackWithResult(callback = result, result = Result.failure<Number>(e))
|
|
270
272
|
}
|
|
273
|
+
}
|
|
271
274
|
}
|
|
272
275
|
}
|
|
273
276
|
@ReactMethod
|