react-native-gizwits-sdk-v5 1.3.83 → 1.3.84
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.
|
@@ -14,6 +14,7 @@ RCT_EXTERN_METHOD(getAuthorizeData:(NSDictionary *)options result:(RCTResponseSe
|
|
|
14
14
|
|
|
15
15
|
RCT_EXTERN_METHOD(logout:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
16
16
|
RCT_EXTERN_METHOD(loginByAnonymous:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
17
|
-
|
|
17
|
+
RCT_EXTERN_METHOD(loginWithAccount:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
18
|
+
RCT_EXTERN_METHOD(registerWithAccount:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
18
19
|
|
|
19
20
|
@end
|
|
@@ -12,9 +12,14 @@ import GizwitsiOSSDK
|
|
|
12
12
|
struct UpdateAuthorizeDataParams: Decodable {
|
|
13
13
|
public var token: String;
|
|
14
14
|
public var uid: String;
|
|
15
|
+
}
|
|
15
16
|
|
|
17
|
+
struct AccountParams: Decodable {
|
|
18
|
+
public var username: String;
|
|
19
|
+
public var password: String;
|
|
16
20
|
}
|
|
17
21
|
|
|
22
|
+
|
|
18
23
|
@objc(RNGizUserManagerModule)
|
|
19
24
|
class RNGizUserManagerModule: RCTEventEmitter {
|
|
20
25
|
|
|
@@ -52,6 +57,24 @@ class RNGizUserManagerModule: RCTEventEmitter {
|
|
|
52
57
|
GizRNCallbackManager.callbackWithResult(callback: result, result: data)
|
|
53
58
|
}
|
|
54
59
|
}
|
|
60
|
+
@objc
|
|
61
|
+
public func registerWithAccount(_ options: NSDictionary, result: @escaping RCTResponseSenderBlock) {
|
|
62
|
+
if let userinfo = RNGizParamsChecker.check(options: options, result: result, paramsType: AccountParams.self) {
|
|
63
|
+
Task {
|
|
64
|
+
let data = await GizUserManager.sharedInstance.registerWithAccount(username: userinfo.username, password: userinfo.password)
|
|
65
|
+
GizRNCallbackManager.callbackWithResult(callback: result, result: data)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
@objc
|
|
70
|
+
public func loginWithAccount(_ options: NSDictionary, result: @escaping RCTResponseSenderBlock) {
|
|
71
|
+
if let userinfo = RNGizParamsChecker.check(options: options, result: result, paramsType: AccountParams.self) {
|
|
72
|
+
Task {
|
|
73
|
+
let data = await GizUserManager.sharedInstance.loginWithAccount(username: userinfo.username, password: userinfo.password)
|
|
74
|
+
GizRNCallbackManager.callbackWithResult(callback: result, result: data)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
55
78
|
|
|
56
79
|
|
|
57
80
|
@objc
|
package/package.json
CHANGED