react-native-gizwits-sdk-v5 1.4.34-2 → 1.4.34-3
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.
|
@@ -27,6 +27,12 @@ RCT_EXTERN_METHOD(sendEmailRegisterVerifyCode:(NSDictionary *)options result:(RC
|
|
|
27
27
|
RCT_EXTERN_METHOD(sendMobileRegisterVerifyCode:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
28
28
|
|
|
29
29
|
RCT_EXTERN_METHOD(registerWithEmail:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
30
|
-
RCT_EXTERN_METHOD(
|
|
30
|
+
RCT_EXTERN_METHOD(registerWithMobile:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
31
31
|
|
|
32
|
+
RCT_EXTERN_METHOD(changePasswordWithOldPassword:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
33
|
+
|
|
34
|
+
RCT_EXTERN_METHOD(sendMobileForgotPasswordVerifyCode:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
35
|
+
RCT_EXTERN_METHOD(forgotWithEmail:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
36
|
+
RCT_EXTERN_METHOD(sendEmailForgotPasswordVerifyCode:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
37
|
+
RCT_EXTERN_METHOD(forgotWithMobile:(NSDictionary *)options result:(RCTResponseSenderBlock)result)
|
|
32
38
|
@end
|
|
@@ -49,6 +49,23 @@ struct RegisterWithMobileParams: Decodable {
|
|
|
49
49
|
public var code: String;
|
|
50
50
|
public var password: String;
|
|
51
51
|
}
|
|
52
|
+
struct ChangePasswordParams: Decodable {
|
|
53
|
+
public var oldPassword: String;
|
|
54
|
+
public var newPassword: String;
|
|
55
|
+
}
|
|
56
|
+
struct ForgotWithEmailParams: Decodable {
|
|
57
|
+
public var email: String;
|
|
58
|
+
public var code: String;
|
|
59
|
+
public var password: String;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
struct ForgotWithMobileParams: Decodable {
|
|
63
|
+
public var phoneCode: String;
|
|
64
|
+
public var phone: String;
|
|
65
|
+
public var code: String;
|
|
66
|
+
public var password: String;
|
|
67
|
+
}
|
|
68
|
+
|
|
52
69
|
|
|
53
70
|
@objc(RNGizUserManagerModule)
|
|
54
71
|
class RNGizUserManagerModule: RCTEventEmitter {
|
|
@@ -173,14 +190,64 @@ class RNGizUserManagerModule: RCTEventEmitter {
|
|
|
173
190
|
}
|
|
174
191
|
|
|
175
192
|
@objc
|
|
176
|
-
public func
|
|
193
|
+
public func registerWithMobile(_ options: NSDictionary, result: @escaping RCTResponseSenderBlock) {
|
|
177
194
|
if let userinfo = RNGizParamsChecker.check(options: options, result: result, paramsType: RegisterWithMobileParams.self) {
|
|
178
195
|
Task {
|
|
179
|
-
let data = await GizUserManager.sharedInstance.
|
|
196
|
+
let data = await GizUserManager.sharedInstance.registerWithMobile(phoneCode: userinfo.phoneCode, phone: userinfo.phone, password: userinfo.password, code: userinfo.code);
|
|
180
197
|
GizRNCallbackManager.callbackWithResult(callback: result, result: data)
|
|
181
198
|
}
|
|
182
199
|
}
|
|
183
200
|
}
|
|
201
|
+
|
|
202
|
+
@objc
|
|
203
|
+
public func changePasswordWithOldPassword(_ options: NSDictionary, result: @escaping RCTResponseSenderBlock) {
|
|
204
|
+
if let info = RNGizParamsChecker.check(options: options, result: result, paramsType: ChangePasswordParams.self) {
|
|
205
|
+
Task {
|
|
206
|
+
let data = await GizUserManager.sharedInstance.changePasswordWithOldPassword(oldPassword: info.oldPassword, newPassword: info.newPassword);
|
|
207
|
+
GizRNCallbackManager.callbackWithResult(callback: result, result: data)
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
@objc
|
|
213
|
+
public func sendMobileForgotPasswordVerifyCode(_ options: NSDictionary, result: @escaping RCTResponseSenderBlock) {
|
|
214
|
+
if let info = RNGizParamsChecker.check(options: options, result: result, paramsType: SendMobileLoginVerifyCodeParams.self) {
|
|
215
|
+
Task {
|
|
216
|
+
let data = await GizUserManager.sharedInstance.sendMobileForgotPasswordVerifyCode(phoneCode: info.phoneCode, phone: info.phone, lang: info.lang);
|
|
217
|
+
GizRNCallbackManager.callbackWithResult(callback: result, result: data)
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
@objc
|
|
222
|
+
public func sendEmailForgotPasswordVerifyCode(_ options: NSDictionary, result: @escaping RCTResponseSenderBlock) {
|
|
223
|
+
if let info = RNGizParamsChecker.check(options: options, result: result, paramsType: SendEmailLoginVerifyCodeParams.self) {
|
|
224
|
+
Task {
|
|
225
|
+
let data = await GizUserManager.sharedInstance.sendEmailForgotPasswordVerifyCode(email: info.email, lang: info.lang);
|
|
226
|
+
GizRNCallbackManager.callbackWithResult(callback: result, result: data)
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
@objc
|
|
232
|
+
public func forgotWithEmail(_ options: NSDictionary, result: @escaping RCTResponseSenderBlock) {
|
|
233
|
+
if let info = RNGizParamsChecker.check(options: options, result: result, paramsType: ForgotWithEmailParams.self) {
|
|
234
|
+
Task {
|
|
235
|
+
let data = await GizUserManager.sharedInstance.forgotWithEmail(email: info.email, code: info.code, password: info.password);
|
|
236
|
+
GizRNCallbackManager.callbackWithResult(callback: result, result: data)
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
@objc
|
|
242
|
+
public func forgotWithMobile(_ options: NSDictionary, result: @escaping RCTResponseSenderBlock) {
|
|
243
|
+
if let info = RNGizParamsChecker.check(options: options, result: result, paramsType: ForgotWithMobileParams.self) {
|
|
244
|
+
Task {
|
|
245
|
+
let data = await GizUserManager.sharedInstance.forgotWithMobile(phoneCode: info.phoneCode, phone: info.phone, code: info.code, password: info.password);
|
|
246
|
+
GizRNCallbackManager.callbackWithResult(callback: result, result: data)
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
184
251
|
|
|
185
252
|
@objc
|
|
186
253
|
override static func requiresMainQueueSetup() -> Bool {
|
package/package.json
CHANGED