question

dev avatar image
dev asked

Error loggin in with Custom ID,Error logging in with custom ID

Hi, I'm new to PlayFab and has followed the "Get Started with Unity" guide, but I'm getting errors when running the code. The error is as follows:

{"code":200,"status":"OK","data":{"SessionTicket":"73AC88AC45D574A9---433A-8D3A8DB10F04D4E-39600EF6B598712C.9FDC35E861D87386","PlayFabId":"73AC88AC45D574A9","NewlyCreated":false,"SettingsForUser":{"NeedsAttribution":false},"LastLoginTime":"2016-07-10T15:57:20.652Z"}}

I have checked the "Players" section in the PlayFab console and I am able to see the login activities, just want to find out why I am getting the error message. Thanks!

Here is my code:

using UnityEngine;

using System.Collections;

using System.Collections.Generic;

using PlayFab;

using PlayFab.ClientModels;



public class PlayfabManager : MonoBehaviour {



    public static PlayfabManager instance;



    public string PlayFabId;



    void Awake(){

        instance = this;

        //Setup Playfab ID

        PlayFabSettings.TitleId = "XXXX"; //Replaced real TitleId with XXXX

    }



    void Start(){

        Login (PlayFabSettings.TitleId);

    }



    void Login(string titleId)

    {

        LoginWithCustomIDRequest request = new LoginWithCustomIDRequest()

        {

            TitleId = titleId,

            CreateAccount = true,

            CustomId = SystemInfo.deviceUniqueIdentifier

        };

        PlayFabClientAPI.LoginWithCustomID(request, (result) => {

            PlayFabId = result.PlayFabId;

            Debug.Log("Got PlayFabID: " + PlayFabId);



            if(result.NewlyCreated)

            {

                Debug.Log("(new account)");

            }

            else

            {

                Debug.Log("(existing account)");

            }

        },

            (error) => {

                Debug.Log("Error logging in player with custom ID:");

                Debug.Log(error.ErrorMessage);

            });

    }
,

Hi, I'm new to PlayFab and have followed the "Get Started with Unity" guide to login with custom ID, but I'm getting the following error in my log:

{"code":200,"status":"OK","data":{"SessionTicket":"73AC88AC45D574A9---433A-8D3A8DB10F04D4E-39600EF6B598712C.9FDC35E861D87386","PlayFabId":"73AC88AC45D574A9","NewlyCreated":false,"SettingsForUser":{"NeedsAttribution":false},"LastLoginTime":"2016-07-10T15:57:20.652Z"}}

I have checked the "Players" tab in the Playfab console and I can see all the login details of the test attempts, just want to find out why it is showing as an error in Unity. Thanks!

Here's my code:

using UnityEngine;

using System.Collections;

using System.Collections.Generic;

using PlayFab;

using PlayFab.ClientModels;



public class PlayfabManager : MonoBehaviour {



    public static PlayfabManager instance;



    public string PlayFabId;



    void Awake(){

        instance = this;

        //Setup Playfab ID

        PlayFabSettings.TitleId = "XXXX"; //Replaced real TitleId with XXXX

    }



    void Start(){

        Login (PlayFabSettings.TitleId);

    }



    void Login(string titleId)

    {

        LoginWithCustomIDRequest request = new LoginWithCustomIDRequest()

        {

            TitleId = titleId,

            CreateAccount = true,

            CustomId = SystemInfo.deviceUniqueIdentifier

        };

        PlayFabClientAPI.LoginWithCustomID(request, (result) => {

            PlayFabId = result.PlayFabId;

            Debug.Log("Got PlayFabID: " + PlayFabId);



            if(result.NewlyCreated)

            {

                Debug.Log("(new account)");

            }

            else

            {

                Debug.Log("(existing account)");

            }

        },

            (error) => {

                Debug.Log("Error logging in player with custom ID:");

                Debug.Log(error.ErrorMessage);

            });

    }
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

As stated in the release notes (https://api.playfab.com/releaseNotes#160705), the initial release of that SDK version had an issue where compression did not always work. It was hot-fixed on July 8th, so if you update your SDK, you shouldn't see this issue anymore. Alternately, you can continue using the version you have if you disable compression (PlayFabSettings.CompressApiData = false;).

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ricardo Chavarria avatar image
Ricardo Chavarria answered

I have the same problem happening to me, but everything was working properly with the previous version of the SDK. Now I changed over to use "GetPlayerCombinedInfoRequestParams" and it's breaking.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

dev avatar image
dev answered

Hi Brendan,

Thanks for the reply. We copied the PlayFabSDK and Plugins folders into our project from the PlayFabClientSample on GitHub and it is working now. Just a note that if we install the SDK through the Unity package, the same error pops up, so you may want to update the Unity package on GitHub as well as the link on your website.

Cheers!

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

Glad to hear you're up and running. And thanks - I'll point that out to the tools team.

0 Likes 0 ·
brendan avatar image brendan commented ·

Indeed, it appears there was an issue with building the package on that SDK version. We'll have it updated shortly - thanks for pointing that out!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.