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
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.
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:
- Go to your Publisher Account.
- Click Open in the Login block and go to Login projects.
- Click Open and set up in the Login project block.
- Go to General settings > Authentication.
- Set the Store friends from social networks toggle to On.
- Save changes.
To make friends from the social network available to the player in the application, implement the following logic in your application:
- Link a social network to a player’s account using the
- Update your friends list using the
- Get a list of friends from a linked social network using the
Was this article helpful?
Rate this page
Don’t want to answer
Thank you for your feedback!
Found a typo or other text error? Select the text and press Ctrl+Enter.