Validate User
To start using the LikeMinds Feed and enable personalized experiences for your users, you need to initiate them within the system. This process associates a user in your application with a user in the LikeMinds Feed, allowing for seamless integration and personalized recommendations.
Steps to initiate User
- Create a ValidateUserRequest object using
ValidateUserRequest.Builder
class by passing all the required parameters. - Call
validateUser()
function using the instance ofLMFeedClient
. - Process the response LMResponse<ValidateUserResponse> as per your requirement.
CoroutineScope(Dispatchers.IO).launch {
// object of ValidateUserRequest
val validateUserRequest = ValidateUserRequest.Builder()
.accessToken("ENTER ACCESS TOKEN")
.refreshToken("ENTER REFRESH TOKEN")
.build()
// get response (LMResponse<ValidateUserResponse>)
val response = LMFeedClient.getInstance().validateUser(validateUserRequest)
if (response.success) {
// your function to process the response data
processValidateUserResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}
Models
ValidateUserRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
accessToken | String | access token for the user | |
refreshToken | String | refresh token for the user |
ValidateUserResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
user | User | Object of the user initiated. | ✔ |
community | Community | Object of the community. | ✔ |
appAccess | Boolean | Object of the user initiated. | ✔ |
logoutResponse | LMResponse<Nothing> | Logout response in case the user doesn't have the access. | ✔ |