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 Session
Build an
InitiateUserRequest
object using theInitiateUserRequestBuilder
class.Call the
initiateUser()
function using the instance of theLMFeedClient
class.Use the response as per your requirement.
// Provide user details for initiating the session
String userName = "user_name_here";
String userId = "user_id_here";
String imageUrl = "user_profile_image_url_here";
// Build the request object
InitiateUserRequest request = (InitiateUserRequestBuilder()
..userName(userName)
..userId(userId)
..imageUrl(imageUrl))
.build();
// Get the response from calling the function
final InitiateUserResponse response = await lmFeedClient.initiateUser(request);
// Process the response, as per requirement
if(response.success){
// your function to process post liked action
processInitiateUserSuccess(response);
}else{
// your function to process error message
processError(response.errorMessage);
}
tip
Initiating a user session allows users to access the LikeMinds community, either as registered users or guests.
Models
InitiateUserRequest
List of parameters for the InitiateUserRequest
class
Variable | Type | Description | Optional |
---|---|---|---|
userName | String | User name | ✔ |
userId | String | User ID | ✔ |
imageUrl | String | URL of the user's profile image | ✔ |
apiKey | String | API key for authentication | ✔ |
InitiateUserResponse
List of parameters for the InitiateUserResponse
class
Variable | Type | Description | Optional |
---|---|---|---|
success | bool | API success status | |
appAccess | bool | Indicates if the user has access to the app | ✔ |
user | User | Details of the initiated user | ✔ |
community | Community | Details of the community | ✔ |
logoutResponse | LogoutResponse | Details of the logout response | ✔ |
accessToken | String | Access token for authentication | ✔ |
refreshToken | String | Refresh token for authentication | ✔ |
errorMessage | String | Error message in case of failure | ✔ |