react-native-gizwits-sdk-v5 1.5.0-beta.3 → 1.5.0-beta.5
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.
|
@@ -23,6 +23,7 @@ RCT_EXTERN_METHOD(updateDeviceInfo:(NSDictionary *)options result:(RCTResponseSe
|
|
|
23
23
|
RCT_EXTERN_METHOD(unBind:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
24
24
|
RCT_EXTERN_METHOD(stopProvideWiFiCredentials:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
25
25
|
RCT_EXTERN_METHOD(provideWiFiCredentials:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
26
|
+
RCT_EXTERN_METHOD(provideWiFiCredentialsWithAirLink:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
26
27
|
|
|
27
28
|
RCT_EXTERN_METHOD(startMusicalRhythm:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
28
29
|
RCT_EXTERN_METHOD(stopMusicalRhythm:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
@@ -80,6 +80,12 @@ struct ProvideWiFiCredentialsParams: Decodable {
|
|
|
80
80
|
var password: String
|
|
81
81
|
var timeout: Int
|
|
82
82
|
}
|
|
83
|
+
struct ProvideWiFiCredentialsWithAirLinkParams: Decodable {
|
|
84
|
+
var ssid: String
|
|
85
|
+
var password: String
|
|
86
|
+
var timeout: Int
|
|
87
|
+
var productKey: String
|
|
88
|
+
}
|
|
83
89
|
struct StopProvideWiFiCredentialsParams: Decodable {
|
|
84
90
|
var type: GizwitsiOSSDK.GizCapability
|
|
85
91
|
var id: String
|
|
@@ -449,7 +455,14 @@ class RNGizDeviceManagerModule: RCTEventEmitter {
|
|
|
449
455
|
|
|
450
456
|
@objc
|
|
451
457
|
public func provideWiFiCredentialsWithAirLink(_ options: NSDictionary, result: @escaping RCTResponseSenderBlock) {
|
|
452
|
-
if let params = RNGizParamsChecker.check(options: options, result: result, paramsType:
|
|
458
|
+
if let params = RNGizParamsChecker.check(options: options, result: result, paramsType: ProvideWiFiCredentialsWithAirLinkParams.self) {
|
|
459
|
+
@Sendable func progressHandler(event: GizWiFiActivatorEvent) {
|
|
460
|
+
// 推送数据到 GizOTAProgressEvent
|
|
461
|
+
let data = [
|
|
462
|
+
"data": event.rawValue
|
|
463
|
+
] as [String : Any]
|
|
464
|
+
sendEvent(withName: "GizProvideWiFiCredentialsEvent", body: data)
|
|
465
|
+
}
|
|
453
466
|
Task {
|
|
454
467
|
var data: GizResult<GizBaseProfile?, GizActivatorException?>
|
|
455
468
|
data = await ESPTouchSmartConfig.sharedInstance.provideWiFiCredentialsWithAirLink(ssid: params.ssid, password: params.password, timeout: params.timeout, productKey: params.productKey, processHandler: progressHandler)
|
package/package.json
CHANGED