react-native-gizwits-sdk-v5 1.7.9-beta → 1.7.10-beta
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/src/main/java/com/gizwits/reactnativegizwitssdkv5/RNGizDeviceManagerModule.kt
CHANGED
|
@@ -188,6 +188,17 @@ class RNGizDeviceManagerModule(reactContext: ReactApplicationContext) : ReactCon
|
|
|
188
188
|
|
|
189
189
|
override fun getName() = "RNGizDeviceManagerModule"
|
|
190
190
|
|
|
191
|
+
/**
|
|
192
|
+
* NativeEventEmitter requires these lifecycle methods on Android. Device
|
|
193
|
+
* events are produced by SDK operations, so there is no native listener
|
|
194
|
+
* resource to allocate or release here.
|
|
195
|
+
*/
|
|
196
|
+
@ReactMethod
|
|
197
|
+
fun addListener(eventName: String) = Unit
|
|
198
|
+
|
|
199
|
+
@ReactMethod
|
|
200
|
+
fun removeListeners(count: Int) = Unit
|
|
201
|
+
|
|
191
202
|
override fun onCatalystInstanceDestroy() {
|
|
192
203
|
super.onCatalystInstanceDestroy()
|
|
193
204
|
moduleScope.cancel() // 取消所有协程
|
|
@@ -114,6 +114,18 @@ class RNGizSDKManagerModule(reactContext: ReactApplicationContext) : ReactContex
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
override fun getName() = "RNGizSDKManagerModule"
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* NativeEventEmitter requires these lifecycle methods on Android. SDK
|
|
120
|
+
* subscriptions are owned by this module's lifecycle rather than by each JS
|
|
121
|
+
* listener, so the methods intentionally do not start or stop subscriptions.
|
|
122
|
+
*/
|
|
123
|
+
@ReactMethod
|
|
124
|
+
fun addListener(eventName: String) = Unit
|
|
125
|
+
|
|
126
|
+
@ReactMethod
|
|
127
|
+
fun removeListeners(count: Int) = Unit
|
|
128
|
+
|
|
117
129
|
private val deviceListState: Flow<List<GizDevice>> =
|
|
118
130
|
combineLatest(
|
|
119
131
|
GizSDKManager.subscribeBoundDeviceList(),
|