1. LoginWithGoogleAccount success!
2. Delete app and load again
3. Login with anonymous (Android Id)
4. LinkGoogleAccount:
new LinkGoogleAccountRequest { ForceLink = null, ServerAuthCode = serverAuthCode }
5. Get error: LinkedAccountAlreadyClaimed 1012
6. LinkGoogleAccount:
if i want delete old account and connect this anonymous account:
new LinkGoogleAccountRequest { ForceLink = true, ServerAuthCode = serverAuthCode }
if I want load old account:
new LinkGoogleAccountRequest { ForceLink = false, ServerAuthCode = serverAuthCode }
But in step 6 I get: InvalidGoogleToken 1026
Please help me!
All code:
void Start() { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() .AddOauthScope("profile") .RequestServerAuthCode(false) .Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate(); WriteLog("\n"); } public void ClickLinkWithGoogle() { LinkWithGoogle(null); } public void ClickUseThisAccount() { LinkWithGoogle(true); DialogWindowYesNo.SetActive(false); } public void ClickLoadOldGoogleAccount() { LinkWithGoogle(false); DialogWindowYesNo.SetActive(false); } public void ClickHideDialogWindow() { DialogWindowYesNo.SetActive(false); } private void LinkWithGoogle(bool? forceLink) { Social.localUser.Authenticate(success => { if (success) { var serverAuthCode = PlayGamesPlatform.Instance.GetServerAuthCode(); PlayFabClientAPI.LinkGoogleAccount(new LinkGoogleAccountRequest { ForceLink = forceLink, ServerAuthCode = serverAuthCode }, result => { LinkWithGoogleButton.GetComponent<Button>().interactable = false; LinkWithGoogleButton.GetComponentInChildren<Text>().text = "Already linked Google"; }, error => { WriteLog("\nGood error: " + error.GenerateErrorReport()); WriteLog("\nGood error (ToString()): " + error); WriteLog("\nError code: " + error.Error); if (error.Error == PlayFabErrorCode.LinkedAccountAlreadyClaimed) { DialogWindowYesNo.SetActive(true); } }); } else { WriteLog("\nFail Google Play Games login (Button)"); } }); }