Kits SDK para Unity / Autenticación mediante ID de dispositivo
  Volver a Documentos

Kits SDK para Unity

Autenticación mediante ID de dispositivo

Device ID authentication lets users start using the application on a mobile device without entering registration data. The first time a user logs in to the application using the device ID, a new account is created automatically, and the user doesn’t need to enter a username, email address, or other data.

Aviso
The account created by the device ID allows using the application only on the current mobile device. Access to it is lost after changing an Android or iOS device or after uninstalling an application on an iOS device. To save progress in the application and use the account on other devices, the user can upgrade the account by linking a social network or by entering a username, email address, and password.

With the device ID, you can implement user authentication on one or more mobile devices in the background mode. To use this function, the user should link the device ID to an existing account.

The SDK supports authentication via ID of mobile devices on Android and iOS.

To enable user authentication via device ID for your project:

  1. Open your project in Publisher Account and go to the Login section.
  2. Click Configure in the pane of a Login project.
  3. In the top settings block on the navigation page, click Login API integration.
  4. Set the Login with device ID toggle to On.
  5. Click Save changes.

Obtener ID de dispositivo

The device ID is generated by the platform and is available in applications installed on the mobile device. The SDK gets the ID value via the platform API and uses this value to perform various functions with the Xsolla API.

The iOS device ID is passed in the UIDevice.identifierForVendor property. The standard Unity method SystemInfo.deviceUniqueIdentifier is used to determine the ID.

The Android device ID is passed in the android.provider.Settings.Secure.ANDROID_ID constant. To determine the ID, use the GetDeviceID SDK method instead of the standard Unity method. The standard Unity method returns the Android device ID as an MD5 hash that cannot be used for Xsolla API calls.

Métodos del SDK

The SDK implements methods for the following functions:

Autenticación

SDK method nameDescription
AuthViaDeviceID
Authenticates the user to the application using the current device ID.
OAuthLogout
Ends the active user session.

Actualización de cuenta

SDK method nameDescription
AddUsernameEmailAuthToAccount
Adds a username, email address, and password, that can be used for authentication, to the current account.
LinkSocialProvider
Links a social network that can be used for authentication to the current account.
Aviso
The listed methods can be used to upgrade an account created in any available way (e.g. by using a social network or an email address and password).

Administración de dispositivos

SDK method nameDescription
GetUserDevices
Returns a list of devices linked to the current user account.
LinkDeviceToAccount
Links the specified device to the current user account.
UnlinkDeviceFromAccount
Unlinks the specified device from the current user account.
¿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.
Valore esta página
Valore esta página
¿Hay algo en lo que podamos mejorar?

Prefiero no responder

¡Gracias por tu mensaje!
Última actualización: 22 de Enero de 2024

¿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!