Autenticação via ID do 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.
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:
- Open your project in Publisher Account and go to the Login section.
- Click Configure in the pane of a Login project.
- In the top settings block on the navigation page, click Login API integration.
- Set the Login with device ID toggle to On.
- Click Save changes.
Obter ID do 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 SDK
The SDK implements methods for the following functions:
Autenticação
SDK method name | Description |
---|---|
AuthViaDeviceID | Authenticates the user to the application using the current device ID. |
OAuthLogout | Ends the active user session. |
Aprimoramento de conta
SDK method name | Description |
---|---|
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. |
Gerenciamento de dispositivos
SDK method name | Description |
---|---|
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. |
Encontrou um erro de texto ou digitação? Selecione o texto e pressione Ctrl+Enter.