Exemple #1
0
    void handleButton(Button b)
    {
        Text buttonText = b.transform.FindChild("Text").GetComponent <Text>() as Text;

        switch (buttonText.text)
        {
        case "Use Device Id":
            PlayFabLoginCalls.RequestSpinner();
            PlayFabLoginCalls.LoginWithDeviceId(false);
            break;

        case "Register":
            authController.activeState = AuthenticationController.LoginStates.Register;
            break;

        case "Exit":
            //authController.activeState = AuthenticationController.LoginStates.Register;
            Application.Quit();
            break;

        case "Enter Account Manually":
            authController.activeState = AuthenticationController.LoginStates.Manual;
            break;
        }
    }
Exemple #2
0
 void HandleOnLoginSuccess(string message)
 {
     SaveLoginPathway();
     PlayFabLoginCalls.RequestSpinner();
     PlayFabLoginCalls.GetAccountInfo();
     this.activeState = LoginStates.LoggedIn;
 }
Exemple #3
0
 /// <summary>
 /// Callback function that we are directing our Android native plugin to return the token to. Currently this is a bit messy, but we needed to guarantee a gameObject would be active to catch the callback.
 /// </summary>
 /// <param name="token">Token from the native plugin</param>
 public void OnGoogleTokenReceived(string token)
 {
     Debug.Log("Token Recieved from the native plugin");
     PlayFabLoginCalls.Token = token;
     Debug.Log(string.Format("g+ Token: {0}", token));
     PlayFabLoginCalls.RequestSpinner();
     PlayFabLoginCalls.SignOnWithGoogle(token);
 }
Exemple #4
0
 void HandleCallbackSuccess(string message, PlayFabAPIMethods method)
 {
     if (method == PlayFabAPIMethods.RegisterPlayFabUser)
     {
         Debug.Log("Account Created, logging in with new account.");
         PlayFabLoginCalls.RequestSpinner();
         PlayFabLoginCalls.LoginWithUsername(user.text, pass1.text);
     }
 }
    /// <summary>
    /// Triggers the backend to send an account recovery email to the account provided
    /// </summary>
    /// <param name="email">Email to match</param>
    public static void SendAccountRecoveryEmail(string email)
    {
        PlayFabLoginCalls.RequestSpinner();
        SendAccountRecoveryEmailRequest request = new SendAccountRecoveryEmailRequest();

        request.Email   = email;
        request.TitleId = PlayFabSettings.TitleId;

        PlayFabClientAPI.SendAccountRecoveryEmail(request, OnSendAccountRecoveryEmailSuccess, OnPlayFabCallbackError);
    }
    /// <summary>
    /// Adds the user name and password to a partial (guest) account
    /// </summary>
    /// <param name="user">User - username to use (must be unique)</param>
    /// <param name="pass">Pass - password to use for the account, (must be > 5 characters)</param>
    /// <param name="email">Email - email to use (must be unique)</param>
    public static void AddUserNameAndPassword(string user, string pass, string email)
    {
        PlayFabLoginCalls.RequestSpinner();
        AddUsernamePasswordRequest request = new AddUsernamePasswordRequest();

        request.Email    = email;
        request.Password = pass;
        request.Username = user;

        PlayFabClientAPI.AddUsernamePassword(request, OnAddUserNameAndPasswordSuccess, OnPlayFabCallbackError);
    }
Exemple #7
0
 public void LogIn()
 {
     PlayFabLoginCalls.RequestSpinner();
     if (User.text.Contains("@"))
     {
         PlayFabLoginCalls.LoginWithEmail(User.text, Password.text);
     }
     else
     {
         PlayFabLoginCalls.LoginWithUsername(User.text, Password.text);
     }
 }
    void Login()
    {
        Debug.Log("Login Path: " + this.loginPathToUse);
        switch (this.loginPathToUse)
        {
        case PlayFabLoginCalls.LoginPathways.pf_username:
            PlayFabLoginCalls.RequestSpinner();
            PlayFabLoginCalls.LoginWithUsername(this.accountInfo.Username, this.password.text);
            break;

        case PlayFabLoginCalls.LoginPathways.pf_email:
            PlayFabLoginCalls.RequestSpinner();
            PlayFabLoginCalls.LoginWithEmail(this.accountInfo.PrivateInfo.Email, this.password.text);
            break;

        case PlayFabLoginCalls.LoginPathways.deviceId:
            PlayFabLoginCalls.RequestSpinner();
            PlayFabLoginCalls.TestDeviceIdHasAccount();
            break;

        case PlayFabLoginCalls.LoginPathways.facebook:
            this.isCounting = false;
            PlayFabLoginCalls.RequestSpinner();
            PlayFabLoginCalls.StartFacebookLogin();
            break;

        case PlayFabLoginCalls.LoginPathways.gameCenter:
            this.isCounting = false;
            PlayFabLoginCalls.RequestSpinner();
            PlayFabLoginCalls.StartGameCenterLogin();
            break;

        case PlayFabLoginCalls.LoginPathways.googlePlus:
            this.isCounting = false;
            PlayFabLoginCalls.RequestSpinner();
            PlayFabLoginCalls.StartGooglePlusLogin();
            break;

        case PlayFabLoginCalls.LoginPathways.steam:
            Debug.LogWarning("Steam Token Authentication not yet implemented.");
            break;
        }
    }
 /// <summary>
 /// Unlinks a mobile device from a PlayFab account
 /// </summary>
 public static void UnlinkDeviceId()
 {
     if (GetDeviceId())
     {
         PlayFabLoginCalls.RequestSpinner();
         if (!string.IsNullOrEmpty(android_id))
         {
             Debug.Log("Unlinking Android");
             UnlinkAndroidDeviceIDRequest request = new UnlinkAndroidDeviceIDRequest();
             PlayFabClientAPI.UnlinkAndroidDeviceID(request, OnUnlinkAndroidDeviceIdSuccess, OnPlayFabCallbackError);
         }
         else if (!string.IsNullOrEmpty(ios_id))
         {
             Debug.Log("Unlinking iOS");
             UnlinkIOSDeviceIDRequest request = new UnlinkIOSDeviceIDRequest();
             PlayFabClientAPI.UnlinkIOSDeviceID(request, OnUnlinkIosDeviceIdSuccess, OnPlayFabCallbackError);
         }
     }
 }
 void CreateNewAndLogin()
 {
     this.newAccountPrompt.gameObject.SetActive(false);
     PlayFabLoginCalls.RequestSpinner();
     PlayFabLoginCalls.LoginWithDeviceId(this.createNewAccount);
 }
Exemple #11
0
 public void RegisterNewAccount()
 {
     PlayFabLoginCalls.RequestSpinner();
     PlayFabLoginCalls.RegisterNewPlayfabAccount(user.text, pass1.text, pass2.text, email.text);
 }
Exemple #12
0
 public void LogIn()
 {
     PlayFabLoginCalls.RequestSpinner();
     PlayFabLoginCalls.StartGameCenterLogin();
 }