hello!
Im new with PlayFab and i try to login with facebook. Everything works fine, but when i check the newlycreated i got every time false.
What i do wrong?
private void OnFacebookLoggedIn(ILoginResult result) { // If result has no errors, it means we have authenticated in Facebook successfully if (result == null || string.IsNullOrEmpty(result.Error)) { SetMessage("Facebook Auth Complete! Access Token: " + AccessToken.CurrentAccessToken.TokenString + "\nLogging into PlayFab..."); /* * We proceed with making a call to PlayFab API. We pass in current Facebook AccessToken and let it create * and account using CreateAccount flag set to true. We also pass the callback for Success and Failure results */ PlayFabClientAPI.LoginWithFacebook(new LoginWithFacebookRequest { CreateAccount = true, AccessToken = AccessToken.CurrentAccessToken.TokenString }, OnPlayfabFacebookAuthComplete, OnPlayfabFacebookAuthFailed); } else { // If Facebook authentication failed, we stop the cycle with the message SetMessage("Facebook Auth Failed: " + result.Error + "\n" + result.RawResult, true); } } // When processing both results, we just set the message, explaining what's going on. private void OnPlayfabFacebookAuthComplete(LoginResult result) { SetMessage("PlayFab Facebook Auth Complete. Session ticket: " + result.SessionTicket); // HA MOST KÉSZÜLT if (result.NewlyCreated) { go_firstLogin.SetActive(true); } else { go_bent.SetActive(true); } },
Hello!
Im new with PlayFab and I try the facebook login. I need to see the user is new or not.
Im try with this code but every time the NewlyCreated is false.
What i do wrong?
private void OnFacebookLoggedIn(ILoginResult result) { // If result has no errors, it means we have authenticated in Facebook successfully if (result == null || string.IsNullOrEmpty(result.Error)) { SetMessage("Facebook Auth Complete! Access Token: " + AccessToken.CurrentAccessToken.TokenString + "\nLogging into PlayFab..."); /* * We proceed with making a call to PlayFab API. We pass in current Facebook AccessToken and let it create * and account using CreateAccount flag set to true. We also pass the callback for Success and Failure results */ PlayFabClientAPI.LoginWithFacebook(new LoginWithFacebookRequest { CreateAccount = true, AccessToken = AccessToken.CurrentAccessToken.TokenString }, OnPlayfabFacebookAuthComplete, OnPlayfabFacebookAuthFailed); } else { // If Facebook authentication failed, we stop the cycle with the message SetMessage("Facebook Auth Failed: " + result.Error + "\n" + result.RawResult, true); } } // When processing both results, we just set the message, explaining what's going on. private void OnPlayfabFacebookAuthComplete(LoginResult result) { SetMessage("PlayFab Facebook Auth Complete. Session ticket: " + result.SessionTicket); // HA MOST KÉSZÜLT if (result.NewlyCreated) { go_firstLogin.SetActive(true); } else { go_bent.SetActive(true); } }