Skip to main content

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​

  1. Create a InitiateUserRequest object using InitiateUserRequest.builder() class by passing all the required parameters.
  2. Call initiateUser() function using the instance of LMFeedClient.
  3. 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​

VARIABLETYPEDESCRIPTIONOPTIONAL
apiKeyStringApi key of the community.
userNameStringName of the user.
uuidStringClient side user unique id.✔
isGuestBooltrue if user is a guest, false otherwise.✔

InitiateUserResponse​

VARIABLETYPEDESCRIPTIONOPTIONAL
accessTokenStringAccess token of the user.✔
refreshTokenStringRefresh token of the user.✔
userUserObject of the user initiated.✔
communityCommunityObject of the community.✔
appAccessBoolObject of the user initiated.✔
logoutResponseLMResponse<NoData>Logout response in case the user doesn't have the access.✔

Community​

VARIABLETYPEDESCRIPTIONOPTIONAL
idStringID of the community.
nameStringName of the community.
imageUrlStringProfile image url of the community.✔
membersCountIntNumber of users in the community.✔
updatedAtIntTimestamp when the community was last updated.✔