react-native-gizwits-sdk-v5 1.4.34-4 → 1.4.34-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.
@@ -63,10 +63,10 @@ dependencies {
63
63
 
64
64
  implementation "androidx.startup:startup-runtime:$startup_version"
65
65
 
66
- implementation("io.github.gizwits:sdk:1.1.4")
67
- implementation("io.github.gizwits:sdk-bluetooth:1.1.4")
68
- implementation("io.github.gizwits:sdk-lan:1.1.4")
69
- implementation("io.github.gizwits:sdk-mqtt:1.1.4")
66
+ implementation("io.github.gizwits:sdk:1.1.5")
67
+ implementation("io.github.gizwits:sdk-bluetooth:1.1.5")
68
+ implementation("io.github.gizwits:sdk-lan:1.1.5")
69
+ implementation("io.github.gizwits:sdk-mqtt:1.1.5")
70
70
  // implementation files('libs/sdk-release.aar', 'libs/sdk-bluetooth-release.aar', 'libs/sdk-lan-release.aar', 'libs/sdk-mqtt-release.aar')
71
71
  implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutine_version")
72
72
  // retrofit
@@ -25,6 +25,77 @@ data class AccountInfoParams(
25
25
  @SerializedName("password")
26
26
  val password: String
27
27
  )
28
+ data class SendMobileLoginVerifyCodeParams(
29
+ @SerializedName("phoneCode")
30
+ val phoneCode: String,
31
+ @SerializedName("phone")
32
+ val phone: String,
33
+ @SerializedName("lang")
34
+ val lang: String?
35
+ )
36
+ data class SendEmailLoginVerifyCodeParams(
37
+ @SerializedName("email")
38
+ val email: String,
39
+ @SerializedName("lang")
40
+ val lang: String?
41
+ )
42
+ data class LoginWithMobileParams(
43
+ @SerializedName("phoneCode")
44
+ val phoneCode: String,
45
+ @SerializedName("phone")
46
+ val phone: String,
47
+ @SerializedName("code")
48
+ val code: String
49
+ )
50
+ data class LoginWithEmailParams(
51
+ @SerializedName("email")
52
+ val email: String,
53
+ @SerializedName("code")
54
+ val code: String
55
+ )
56
+ data class RegisterWithEmailParams(
57
+ @SerializedName("email")
58
+ val email: String,
59
+ @SerializedName("code")
60
+ val code: String,
61
+ @SerializedName("password")
62
+ val password: String
63
+ )
64
+ data class RegisterWithMobileParams(
65
+ @SerializedName("phoneCode")
66
+ val phoneCode: String,
67
+ @SerializedName("phone")
68
+ val phone: String,
69
+ @SerializedName("code")
70
+ val code: String,
71
+ @SerializedName("password")
72
+ val password: String,
73
+ )
74
+ data class ChangePasswordWithOldPasswordParams(
75
+ @SerializedName("oldPassword")
76
+ val oldPassword: String,
77
+ @SerializedName("newPassword")
78
+ val newPassword: String
79
+ )
80
+ data class ForgotWithEmailParams(
81
+ @SerializedName("email")
82
+ val email: String,
83
+ @SerializedName("code")
84
+ val code: String,
85
+ @SerializedName("password")
86
+ val password: String,
87
+ )
88
+ data class ForgotWithMobileParams(
89
+ @SerializedName("phoneCode")
90
+ val phoneCode: String,
91
+ @SerializedName("phone")
92
+ val phone: String,
93
+ @SerializedName("code")
94
+ val code: String,
95
+ @SerializedName("password")
96
+ val password: String,
97
+ )
98
+
28
99
 
29
100
 
30
101
  class RNGizUserManagerModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
@@ -83,4 +154,160 @@ class RNGizUserManagerModule(reactContext: ReactApplicationContext) : ReactConte
83
154
 
84
155
  }
85
156
  }
157
+
158
+ @ReactMethod
159
+ fun sendMobileLoginVerifyCode(options: ReadableMap, result: Callback) {
160
+ var config = RNGizParamsChecker.check(options, result, SendMobileLoginVerifyCodeParams::class.java)
161
+ config?.let {
162
+ CoroutineScope(Dispatchers.IO).launch {
163
+ val res = GizSDKManager.getUserManager().sendMobileLoginVerifyCode(config.phoneCode, config.phone, config.lang)
164
+ GizRNCallbackManager.callbackWithResult(callback = result, result = res)
165
+ }
166
+
167
+ }
168
+ }
169
+
170
+ @ReactMethod
171
+ fun sendEmailLoginVerifyCode(options: ReadableMap, result: Callback) {
172
+ var config = RNGizParamsChecker.check(options, result, SendEmailLoginVerifyCodeParams::class.java)
173
+ config?.let {
174
+ CoroutineScope(Dispatchers.IO).launch {
175
+ val res = GizSDKManager.getUserManager().sendEmailLoginVerifyCode(config.email, config.lang)
176
+ GizRNCallbackManager.callbackWithResult(callback = result, result = res)
177
+ }
178
+
179
+ }
180
+ }
181
+
182
+ @ReactMethod
183
+ fun loginWithMobile(options: ReadableMap, result: Callback) {
184
+ var config = RNGizParamsChecker.check(options, result, LoginWithMobileParams::class.java)
185
+ config?.let {
186
+ CoroutineScope(Dispatchers.IO).launch {
187
+ val res = GizSDKManager.getUserManager().loginWithMobile(config.phoneCode, config.phone, config.code)
188
+ GizRNCallbackManager.callbackWithResult(callback = result, result = res)
189
+ }
190
+
191
+ }
192
+ }
193
+ @ReactMethod
194
+ fun loginWithEmail(options: ReadableMap, result: Callback) {
195
+ var config = RNGizParamsChecker.check(options, result, LoginWithEmailParams::class.java)
196
+ config?.let {
197
+ CoroutineScope(Dispatchers.IO).launch {
198
+ val res = GizSDKManager.getUserManager().loginWithEmail(config.email, config.code)
199
+ GizRNCallbackManager.callbackWithResult(callback = result, result = res)
200
+ }
201
+
202
+ }
203
+ }
204
+
205
+ @ReactMethod
206
+ fun sendMobileRegisterVerifyCode(options: ReadableMap, result: Callback) {
207
+ var config = RNGizParamsChecker.check(options, result, SendMobileLoginVerifyCodeParams::class.java)
208
+ config?.let {
209
+ CoroutineScope(Dispatchers.IO).launch {
210
+ val res = GizSDKManager.getUserManager().sendMobileRegisterVerifyCode(config.phoneCode, config.phone, config.lang)
211
+ GizRNCallbackManager.callbackWithResult(callback = result, result = res)
212
+ }
213
+
214
+ }
215
+ }
216
+
217
+ @ReactMethod
218
+ fun sendEmailRegisterVerifyCode(options: ReadableMap, result: Callback) {
219
+ var config = RNGizParamsChecker.check(options, result, SendEmailLoginVerifyCodeParams::class.java)
220
+ config?.let {
221
+ CoroutineScope(Dispatchers.IO).launch {
222
+ val res = GizSDKManager.getUserManager().sendEmailRegisterVerifyCode(config.email, config.lang)
223
+ GizRNCallbackManager.callbackWithResult(callback = result, result = res)
224
+ }
225
+
226
+ }
227
+ }
228
+
229
+
230
+ @ReactMethod
231
+ fun registerWithEmail(options: ReadableMap, result: Callback) {
232
+ var config = RNGizParamsChecker.check(options, result, RegisterWithEmailParams::class.java)
233
+ config?.let {
234
+ CoroutineScope(Dispatchers.IO).launch {
235
+ val res = GizSDKManager.getUserManager().registerWithEmail(config.email, config.code, config.password)
236
+ GizRNCallbackManager.callbackWithResult(callback = result, result = res)
237
+ }
238
+
239
+ }
240
+ }
241
+
242
+ @ReactMethod
243
+ fun registerWithMobile(options: ReadableMap, result: Callback) {
244
+ var config = RNGizParamsChecker.check(options, result, RegisterWithMobileParams::class.java)
245
+ config?.let {
246
+ CoroutineScope(Dispatchers.IO).launch {
247
+ val res = GizSDKManager.getUserManager().registerWithMobile(config.phoneCode, config.phone, config.code, config.password)
248
+ GizRNCallbackManager.callbackWithResult(callback = result, result = res)
249
+ }
250
+
251
+ }
252
+ }
253
+
254
+ @ReactMethod
255
+ fun changePasswordWithOldPassword(options: ReadableMap, result: Callback) {
256
+ var config = RNGizParamsChecker.check(options, result, ChangePasswordWithOldPasswordParams::class.java)
257
+ config?.let {
258
+ CoroutineScope(Dispatchers.IO).launch {
259
+ val res = GizSDKManager.getUserManager().changePasswordWithOldPassword(config.oldPassword, config.newPassword)
260
+ GizRNCallbackManager.callbackWithResult(callback = result, result = res)
261
+ }
262
+
263
+ }
264
+ }
265
+
266
+ @ReactMethod
267
+ fun sendMobileForgotPasswordVerifyCode(options: ReadableMap, result: Callback) {
268
+ var config = RNGizParamsChecker.check(options, result, SendMobileLoginVerifyCodeParams::class.java)
269
+ config?.let {
270
+ CoroutineScope(Dispatchers.IO).launch {
271
+ val res = GizSDKManager.getUserManager().sendMobileForgotPasswordVerifyCode(config.phoneCode, config.phone, config.lang)
272
+ GizRNCallbackManager.callbackWithResult(callback = result, result = res)
273
+ }
274
+
275
+ }
276
+ }
277
+
278
+ @ReactMethod
279
+ fun sendEmailForgotPasswordVerifyCode(options: ReadableMap, result: Callback) {
280
+ var config = RNGizParamsChecker.check(options, result, SendEmailLoginVerifyCodeParams::class.java)
281
+ config?.let {
282
+ CoroutineScope(Dispatchers.IO).launch {
283
+ val res = GizSDKManager.getUserManager().sendEmailForgotPasswordVerifyCode(config.email, config.lang)
284
+ GizRNCallbackManager.callbackWithResult(callback = result, result = res)
285
+ }
286
+
287
+ }
288
+ }
289
+
290
+ @ReactMethod
291
+ fun forgotWithEmail(options: ReadableMap, result: Callback) {
292
+ var config = RNGizParamsChecker.check(options, result, ForgotWithEmailParams::class.java)
293
+ config?.let {
294
+ CoroutineScope(Dispatchers.IO).launch {
295
+ val res = GizSDKManager.getUserManager().forgotWithEmail(config.email, config.code, config.password)
296
+ GizRNCallbackManager.callbackWithResult(callback = result, result = res)
297
+ }
298
+
299
+ }
300
+ }
301
+
302
+ @ReactMethod
303
+ fun forgotWithMobile(options: ReadableMap, result: Callback) {
304
+ var config = RNGizParamsChecker.check(options, result, ForgotWithMobileParams::class.java)
305
+ config?.let {
306
+ CoroutineScope(Dispatchers.IO).launch {
307
+ val res = GizSDKManager.getUserManager().forgotWithMobile(config.phoneCode, config.phone, config.code, config.password)
308
+ GizRNCallbackManager.callbackWithResult(callback = result, result = res)
309
+ }
310
+
311
+ }
312
+ }
86
313
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gizwits-sdk-v5",
3
- "version": "1.4.34-4",
3
+ "version": "1.4.34-5",
4
4
  "description": "Gizwits",
5
5
  "homepage": "https://github.com/demchenkoalex/react-native-gizwits-sdk-v5#readme",
6
6
  "main": "lib/index.js",