Hello, I stuck with this error.
I'm trying to add PlayFab into a project. I'm using a project that I found in one of answer here (UnicornBattle) as base.
I wanna register an user. so I'm using "request=newRegisterPlayFabUserRequest()". but its failing an returning that destination error.
I couldn't figure out how to solve.
My classes
using PlayFab; using PlayFab.ClientModels; using UnityEngine; public class PlayFabAuthManager : MonoBehaviour { public delegate void SuccessfulLoginHandler(string details); public delegate void FailedLoginHandler(string details); public static event SuccessfulLoginHandler OnLoginSuccess; public static event FailedLoginHandler OnLoginFail; public string AndroidId { get; private set; } public string IosId { get; private set; } public bool IsLoggedOut { get; } public static void RegisterNewPlayfabAccount(string email, string password) { //TODO // Validate email and password var request = new RegisterPlayFabUserRequest() { TitleId = PlayFabSettings.TitleId, Email = email, Password = password }; PlayFabClientAPI.RegisterPlayFabUser(request, OnRegisterResult, OnLoginError); } private static void OnLoginError(PlayFabError error) { string errorMessage; if (error.Error == PlayFabErrorCode.InvalidParams && error.ErrorDetails.ContainsKey("Password")) { errorMessage = "Invalid Password"; } else if (error.Error == PlayFabErrorCode.InvalidParams && error.ErrorDetails.ContainsKey("Username") || (error.Error == PlayFabErrorCode.InvalidUsername)) { errorMessage = "Invalid Username"; } else if (error.Error == PlayFabErrorCode.AccountNotFound) { errorMessage = "Account Not Found, you must have a linked PlayFab account. Start by registering a new account or using your device id"; } else if (error.Error == PlayFabErrorCode.AccountBanned) { errorMessage = "Account Banned"; } else if (error.Error == PlayFabErrorCode.InvalidUsernameOrPassword) { errorMessage = "Invalid Username or Password"; } else { errorMessage = string.Format("Error {0}: {1}", error.HttpCode, error.ErrorMessage); } if (OnLoginFail != null) { OnLoginFail(errorMessage); } Debug.LogWarning(errorMessage); } private static void OnRegisterResult(RegisterPlayFabUserResult result) { if (OnLoginSuccess != null) { OnLoginSuccess("New Account Registered"); } Debug.LogWarning("New Account Registered"); } }
using UnityEngine.UI; using UnityEngine; public class PlayFabLoginRegister : MonoBehaviour { [SerializeField] private GameObject logFeedback; [SerializeField] private Text feedbackText; [SerializeField] private Button loginButton; [SerializeField] private InputField loginEmail; [SerializeField] private InputField loginPassword; [SerializeField] private Button registerButton; [SerializeField] private InputField registerEmail; [SerializeField] private InputField registerPassword; private void Start() { registerButton.onClick.AddListener(RegisterNewAccount); } private void RegisterNewAccount() { PlayFabAuthManager.RegisterNewPlayfabAccount(registerEmail.text, registerPassword.text); } public void RegistrationFail() { //TODO logFeedback.SetActive(true); } }