react-native-gizwits-sdk-v5 1.3.48 → 1.3.50
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,12 +63,12 @@ dependencies {
|
|
|
63
63
|
|
|
64
64
|
implementation "androidx.startup:startup-runtime:$startup_version"
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
implementation("io.github.gizwits:sdk:1.0.40")
|
|
67
|
+
implementation("io.github.gizwits:sdk-bluetooth:1.0.40")
|
|
68
|
+
implementation("io.github.gizwits:sdk-lan:1.0.40")
|
|
69
|
+
implementation("io.github.gizwits:sdk-mqtt:1.0.40")
|
|
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
|
|
|
73
73
|
|
|
74
74
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutine_version")
|
|
@@ -44,6 +44,14 @@ data class GizGetProductConfig(
|
|
|
44
44
|
val productKey: String,
|
|
45
45
|
)
|
|
46
46
|
|
|
47
|
+
data class GizFeedback(
|
|
48
|
+
@SerializedName("uploadLog")
|
|
49
|
+
val uploadLog: Boolean,
|
|
50
|
+
@SerializedName("content")
|
|
51
|
+
val content: String,
|
|
52
|
+
@SerializedName("contact")
|
|
53
|
+
val contact: String,
|
|
54
|
+
)
|
|
47
55
|
|
|
48
56
|
class RNGizSDKManagerModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
|
49
57
|
|
|
@@ -272,4 +280,22 @@ class RNGizSDKManagerModule(reactContext: ReactApplicationContext) : ReactContex
|
|
|
272
280
|
GizSDKManager.stopBleScan()
|
|
273
281
|
GizRNCallbackManager.callbackWithResult(callback = result, result = Result.success<Number>(0))
|
|
274
282
|
}
|
|
283
|
+
|
|
284
|
+
@ReactMethod
|
|
285
|
+
fun cleanCache(options: ReadableMap, result: Callback) {
|
|
286
|
+
GizSDKManager.cleanCache()
|
|
287
|
+
GizRNCallbackManager.callbackWithResult(callback = result, result = Result.success<Number>(0))
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
@ReactMethod
|
|
291
|
+
fun feedback(options: ReadableMap, result: Callback) {
|
|
292
|
+
var config = RNGizParamsChecker.check(options, result, GizFeedback::class.java)
|
|
293
|
+
config?.let {
|
|
294
|
+
CoroutineScope(Dispatchers.Main).launch {
|
|
295
|
+
GizSDKManager.feedback(config.uploadLog,config.contact,config.content)
|
|
296
|
+
GizRNCallbackManager.callbackWithResult(callback = result, result = Result.success<Number>(0))
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
}
|
|
275
301
|
}
|
|
@@ -12,6 +12,11 @@ import GizwitsiOSSDK
|
|
|
12
12
|
struct GetProductConfigParams: Decodable {
|
|
13
13
|
var productKey:String
|
|
14
14
|
}
|
|
15
|
+
struct GizFeedbackParams: Decodable {
|
|
16
|
+
var uploadLog:Bool
|
|
17
|
+
var contact:String
|
|
18
|
+
var content:String
|
|
19
|
+
}
|
|
15
20
|
|
|
16
21
|
@objc(RNGizSDKManagerModule)
|
|
17
22
|
class RNGizSDKManagerModule: RCTEventEmitter, GizSdkEventHandlerDelegate {
|
|
@@ -96,6 +101,24 @@ class RNGizSDKManagerModule: RCTEventEmitter, GizSdkEventHandlerDelegate {
|
|
|
96
101
|
GizRNCallbackManager.callbackWithResult(callback: result, result: GizResult<Int?, GizAPIException?>(data: nil, success: true))
|
|
97
102
|
}
|
|
98
103
|
|
|
104
|
+
@objc
|
|
105
|
+
public func cleanCache(_ options: NSDictionary, result: @escaping RCTResponseSenderBlock) {
|
|
106
|
+
GizSDKManager.sharedInstance.cleanCache()
|
|
107
|
+
GizRNCallbackManager.callbackWithResult(callback: result, result: GizResult<Int?, GizAPIException?>(data: nil, success: true))
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@objc
|
|
111
|
+
public func feedback(_ options: NSDictionary, result: @escaping RCTResponseSenderBlock) {
|
|
112
|
+
if let config = RNGizParamsChecker.check(options: options, result: result, paramsType: GizFeedbackParams.self) {
|
|
113
|
+
Task {
|
|
114
|
+
GizSDKManager.sharedInstance.feedback(uploadLog: config.uploadLog, content: config.content, contact: config.contact)
|
|
115
|
+
GizRNCallbackManager.callbackWithResult(callback: result, result: GizResult<Int?, GizAPIException?>(data: nil, success: true))
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
}
|
|
121
|
+
|
|
99
122
|
@objc
|
|
100
123
|
override static func requiresMainQueueSetup() -> Bool {
|
|
101
124
|
return true
|
package/package.json
CHANGED