Hello,
I followed the steps below to create an account:
Tried to log in with LoginWithEmail API.
If there was no appropriate account in step 1, I created an account with the LoginWithCustomID API.
Added email, password, and username using the AddUsernamePassword API.
Went back to step 1 to try to log in again.
I confirmed that I was able to create one ID and input information successfully by following the above steps.
However, the problem occurs when I try to access the ID created above on a different device. (Let's call the original device "A" and the other device "B".)
First of all, it is possible to access the ID created through the above process on device "B" without any problems.
However, when I try to log in with step 1 on device "B," an additional account with a Custom ID Account is created.
The reason I call it step 1 is because the logs that should be shown in steps 2 and 3 are not visible.
If I check the account that was additionally created, there is no other information besides the Custom ID Account.
I would appreciate it if you could let me know why this situation is happening and what the solution is.
am not sure if this inquiry was written properly through translation. Please let me know if there is any additional information needed.
/* Here is the related code
bool createaccount = false;
public void Start()
{
#if UNITY_ANDROID && !UNITY_EDITOR
LoginSet();
GoogleLogin();
#endif
}
void LoginSet()
{
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
}
public void GoogleLogin()
{
createaccount = false;
Social.localUser.Authenticate((success) =>
{
if (success) { PlayFabLogin(); }
});
}
public void PlayFabLogin()
{
var request = new LoginWithEmailAddressRequest { Email = Social.localUser.id + "@test.com", Password = "test" + Social.localUser.id};
PlayFabClientAPI.LoginWithEmailAddress(request, (result) => { OnLoginSuccess(result); },
(error) => { createaccount = true; CustomIdLogin(); });
}
void CustomIdLogin()
{
PlayFabClientAPI.LoginWithCustomID(new LoginWithCustomIDRequest()
{
CustomId = SystemInfo.deviceUniqueIdentifier,
CreateAccount = createaccount
}, result =>
{
AddUsernamePassword(result);
},
(error) =>
{
OnLoginFailure(error);
});
}
public void AddUsernamePassword(LoginResult result)
{
string email = Social.localUser.id + "@test.com";
string password = "test" + Social.localUser.id;
string username = result.PlayFabId;
var request = new AddUsernamePasswordRequest
{
Email = email,
Password = password,
Username = username,
};
PlayFabClientAPI.AddUsernamePassword(request, res => {
PlayFabLogin();
}, error => {
});;
}