Initiate 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 InitiateUserRequest object using
InitiateUserRequest.builder()
class by passing all the required parameters. - Call
initiateUser()
function using the instance ofLMFeedClient
. - Process the response LMResponse<InitiateUserResponse> as per your requirement.
// object of InitiateUserRequest
let request = InitiateUserRequest.builder()
.apiKey(apiKey) // api key of the community
.userName(userName) // name of the user
.uuid(userId) // client side user unique ID
.isGuest(isGuest) // user is a guest or not
.build()
LMFeedClient.shared.initiateUser(request) { response in
// Response (LMResponse<InitiateUserResponse>)
if (response.success) {
// your function to process the response data
processResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}
Models
InitiateUserRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
apiKey | String | Api key of the community. | |
userName | String | Name of the user. | |
uuid | String | Client side user unique id. | ✔ |
isGuest | Bool | true if user is a guest, false otherwise. | ✔ |
InitiateUserResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
accessToken | String | Access token of the user. | ✔ |
refreshToken | String | Refresh token of the user. | ✔ |
user | User | Object of the user initiated. | ✔ |
community | Community | Object of the community. | ✔ |
appAccess | Bool | Object of the user initiated. | ✔ |
logoutResponse | LMResponse<NoData> | Logout response in case the user doesn't have the access. | ✔ |
Community
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
id | String | ID of the community. | |
name | String | Name of the community. | |
imageUrl | String | Profile image url of the community. | ✔ |
membersCount | Int | Number of users in the community. | ✔ |
updatedAt | Int | Timestamp when the community was last updated. | ✔ |