react-native-gizwits-sdk-v5 1.3.84 → 1.3.85
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.
|
@@ -19,6 +19,13 @@ data class UpdateAuthorizeDataParams(
|
|
|
19
19
|
@SerializedName("uid")
|
|
20
20
|
val uid: String
|
|
21
21
|
)
|
|
22
|
+
data class AccountInfoParams(
|
|
23
|
+
@SerializedName("username")
|
|
24
|
+
val username: String,
|
|
25
|
+
@SerializedName("password")
|
|
26
|
+
val password: String
|
|
27
|
+
)
|
|
28
|
+
|
|
22
29
|
|
|
23
30
|
class RNGizUserManagerModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
|
24
31
|
override fun getName() = "RNGizUserManagerModule"
|
|
@@ -53,4 +60,21 @@ class RNGizUserManagerModule(reactContext: ReactApplicationContext) : ReactConte
|
|
|
53
60
|
GizRNCallbackManager.callbackWithResult(callback = result, result = res)
|
|
54
61
|
}
|
|
55
62
|
}
|
|
63
|
+
|
|
64
|
+
@ReactMethod
|
|
65
|
+
fun loginWithAccount(options: ReadableMap, result: Callback) {
|
|
66
|
+
var config = RNGizParamsChecker.check(options, result, AccountInfoParams::class.java)
|
|
67
|
+
config?.let {
|
|
68
|
+
val res = GizSDKManager.getUserManager().loginWithAccount(config.username, config.password)
|
|
69
|
+
GizRNCallbackManager.callbackWithResult(callback = result, result = res)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
@ReactMethod
|
|
73
|
+
fun registerWithAccount(options: ReadableMap, result: Callback) {
|
|
74
|
+
var config = RNGizParamsChecker.check(options, result, AccountInfoParams::class.java)
|
|
75
|
+
config?.let {
|
|
76
|
+
val res = GizSDKManager.getUserManager().registerWithAccount(config.username, config.password)
|
|
77
|
+
GizRNCallbackManager.callbackWithResult(callback = result, result = res)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
56
80
|
}
|