Gestión de usuarios

Learn about advanced setups from our how-tos.

Cómo trabajar con los atributos de usuario

You can use attributes to manage additional information about the users of your application. The user attribute is a key-value pair. The SDK supports the following types of attributes:

  • User-editable attributes. The values for this type of attributes are entered by a user or specified according to the in-game logics on the client side. For example: the name and character stats, game difficulty level, etc.
  • Read-only attributes. The values for this type of attributes are entered and edited on the server side of your application. We recommend you use them for configuration of game character stats or user parameters that shouldn’t be changed a lot. For example: use them for the chance to get a bonus, game character key parameters, user categories, etc.

To manage user attributes, use the following SDK methods:

When working with read-only attributes, you can use a server token or a Publisher Account token for authorization.

To get the Publisher Account token:

  1. Enter your Publisher Account.
  2. Go to the cookie files viewpage via the developers’ tools in your browser.
  3. Copy the value from the pa-v4-token parameter and paste it to the Authorization header.

¿Te ha resultado útil este artículo?
¡Gracias!
¿Hay algo en lo que podamos mejorar? Mensaje
Lo sentimos
Por favor, cuéntanos por qué no te ha resultado útil este artículo. Mensaje
¡Gracias por tu mensaje!
Nos ayudará a mejorar tu experiencia.
Ocultar

Cómo trabajar con la cuenta de usuario en su aplicación

Users can configure the following data from a user account:

  • public profile data:
    • avatar
    • nickname

  • personal user data:
    • name and surname
    • birthdate
    • gender
    • phone number
    • email
Nota
To set some additional user parameters or set the parameters of a game character, use the instruction on how to work with user attributes. You can add the friend list management functionality in the user account if the friend system is implemented in the application.

You can manage the user account via the API calls. The Login & Account System asset has the following methods implemented:

  • GetUserInfo — updates locally cached user data.

Nota
The user can set their birthdate only once. The entered value can’t be changed in the future.
  • UpdateUserInfo — changes the specified user’s data.
  • GetUserPhoneNumber — updates the locally cached user phone number.
  • ChangeUserPhoneNumber — changes the user’s phone number.
  • DeleteUserPhoneNumber — deletes the user’s phone number.
  • UploadUserPicture — changes the user’s avatar.
  • DeleteProfilePicture — deletes the user’s avatar.
¿Te ha resultado útil este artículo?
¡Gracias!
¿Hay algo en lo que podamos mejorar? Mensaje
Lo sentimos
Por favor, cuéntanos por qué no te ha resultado útil este artículo. Mensaje
¡Gracias por tu mensaje!
Nos ayudará a mejorar tu experiencia.
Ocultar

Cómo trabajar con el sistema de amigos en su aplicación

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.

Métodos del SDK

The Login & Account System asset has the following methods of working with the friend system:

  • GetUserFriends — updates the locally cached user friends data. The Get user’s friends API call is used alongside the SDK method.

  • UpdateUserFriends — updates the status of the user’s social connections. The Update user’s friends API call is used alongside the SDK method. 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
  • GetUserSocialFriends — updates the locally cached data of user’s friends from a social network. The Get social account friends API call is used alongside the SDK method.
  • GetPublicInfo — gets data from the user’s public profile. The Get user public profile API call is used alongside the SDK method.
  • SearchUsers — searches for the user by nickname. The Search users by nickname API call is used alongside the SDK method.
  • GetLinkedSocialProviders — updates the user’s social networks data. The Get linked networks API call is used alongside the SDK method.

Implementación de un sistema de amigos para las redes sociales

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 GetSocialNetworkAuthUrl method. The Get URL to link social network to account API call is used alongside the SDK method.
  2. Update your friends list using the UpdateUserSocialFriends method. The Update social account friends API call is used alongside the SDK method.
  3. Get a list of friends from a linked social network using the GetUserSocialFriends method. The Get social account friends API call is used alongside the SDK method.

¿Te ha resultado útil este artículo?
¡Gracias!
¿Hay algo en lo que podamos mejorar? Mensaje
Lo sentimos
Por favor, cuéntanos por qué no te ha resultado útil este artículo. Mensaje
¡Gracias por tu mensaje!
Nos ayudará a mejorar tu experiencia.
Ocultar
Última actualización: 10 de Octubre de 2023

¿Has encontrado una errata u otro error de texto? Selecciona el texto y pulsa Ctrl+Intro.

Informar de un problema
Nos esforzamos por ofrecer contenido de calidad. Tus comentarios nos ayudan a mejorar.
Déjanos tu correo electrónico para que te podamos responder
¡Gracias por tu mensaje!