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 Session

  1. Build an InitiateUserRequest object using the InitiateUserRequestBuilder class.

  2. Call the initiateUser() function using the instance of the LMFeedClient class.

  3. 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

VariableTypeDescriptionOptional
userNameStringUser name
userIdStringUser ID
imageUrlStringURL of the user's profile image
apiKeyStringAPI key for authentication

InitiateUserResponse

List of parameters for the InitiateUserResponse class

VariableTypeDescriptionOptional
successboolAPI success status
appAccessboolIndicates if the user has access to the app
userUserDetails of the initiated user
communityCommunityDetails of the community
logoutResponseLogoutResponseDetails of the logout response
accessTokenStringAccess token for authentication
refreshTokenStringRefresh token for authentication
errorMessageStringError message in case of failure