Friend system

The friend system allows your users to find each other and set up social connections. The SDK supports the following functionality:

  • search by nickname
  • get the list of friends from social networks
  • manage the friend list, send invitations, add and remove friends, block users, etc.
  • manage personal data via the user account

To implement the friend system, you should have the user account functionality in your application. Methods of working with this system use the following parameters from the user account:

  • user ID
  • avatar
  • nickname

Users should specify the nickname to ensure the friend system works correctly. Implement the following nickname specification logics:

  • Use the name that was used for registration via login and password as a nickname.
  • Implement the nickname request during social authentication or platform accounts.

SDK methods

The SDK has the following methods of working with the friend system:

  • ModifyFriends — updates the user friends data.

  • ModifyFriends — updates the status of the user’s social connections. The social connections status is affected by the following actions:
    • send or cancel a friend request
    • accept or decline a friend request
    • delete the user from the friend list
    • block or unblock the user

  • GetSocialFriends — gets the data of user’s friends from a social network.

  • GetUserProfile — gets data from the user’s public profile.

  • SearchUsersByNickname — searches for the user by nickname.

  • LinkSocialNetworkToUserAccount — links the user account and a social network that the player uses for authentication.

  • GetLinkedSocialNetworks — updates the user’s social networks data.

Implementing a friends system for social networks

To let users interact with friends from social networks in your application, configure the storage of friend data on the Xsolla side:

  1. Go to your Publisher Account.
  2. Click Open in the Login block and go to Login projects.
  3. Click Open and set up in the Login project block.
  4. Go to General settings > Authentication.
  5. Set the Store friends from social networks toggle to On.
  6. Save changes.

To make friends from the social network available to the player in the application, implement the following logic in your application:

  1. Link a social network to a player’s account using the LinkSocialNetworkToUserAccount method.
  2. Update your friends list using the GetUsersFriends method.
  3. Get a list of friends from a linked social network using the GetSocialFriends method.

Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Rate this page
Rate this page
Is there anything we can improve?

Don’t want to answer

Thank you for your feedback!
Last updated: August 24, 2022

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!