question

Mehmet Fatih Barut avatar image
Mehmet Fatih Barut asked

Unity LoginWithAndroidDeviceID not working

Hi,

I tried everything and obviously LoginWithAndroidDeviceID not working.

Login with email is working but LoginWithAndroidDeviceID is not working. I don't know why.

Here is the code I used.

     var requestedAndroid = new LoginWithAndroidDeviceIDRequest { DeviceId = ReturnMobileID(), TitleId = "xxxxx", CreateAccount = true };
        PlayFabClientAPI.LoginWithAndroidDeviceID(requestedAndroid, OnLoginAndroidSuccess, OnLoginAndroidFailure);
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mehmet Fatih Barut avatar image
Mehmet Fatih Barut answered

It was a really bad bug. I changed the DeviceId variable into AndroidDeviceId in the PlayFabClientModels.cs file and it worked. Please you also correct it in the next release.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sarah Zhang avatar image
Sarah Zhang answered

There is a typo in the line one. Please check the documentation -- https://docs.microsoft.com/rest/api/playfab/client/authentication/loginwithandroiddeviceid. You can modify the property name - DeviceId to AndroidDeviceId to fix it and call this API again. Besides, if you are using Unity, you can add the Debug.log() method in the OnLoginAndroidFailure callback function to log the error messages for troubleshooting. The code could be something like this.

private void OnLoginAndroidFailure(PlayFabError error)
{     
Debug.Log(error.GenerateErrorReport());  
}
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mehmet Fatih Barut avatar image Mehmet Fatih Barut commented ·

Interestingly there is no typo. look at the function below, It is really written as DeviceID in original .cs file

0 Likes 0 ·
Mehmet Fatih Barut avatar image Mehmet Fatih Barut commented ·

public class LoginWithAndroidDeviceIDRequest : PlayFabRequestCommon {

/// <summary>

/// Specific model of the user's device.

/// </summary> public string AndroidDevice;

/// <summary>

/// Android device identifier for the user's device.

/// </summary> public string DeviceId;

0 Likes 0 ·
Mehmet Fatih Barut avatar image
Mehmet Fatih Barut answered

thanks a lot I am trying

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.