question

hp avatar image
hp asked

LoginWithCustomID with GetPlayerCombinedInfoRequestParams doesn't work?

I have been trying to get player info via LoginWithCustomID method and can't get GetPlayerCombinedInfoRequestParams to work with it. Here is the code I use:

GetPlayerCombinedInfoRequestParams parameters = new GetPlayerCombinedInfoRequestParams(){
   GetUserAccountInfo = true,
   GetPlayerStatistics = true
   // I have tried by defining PlayerStatisticNames also, but still doesn't work
   // PlayerStatisticNames = new List<string>(){"Wins"}

};

LoginWithCustomIDRequest request = new LoginWithCustomIDRequest();
request.TitleId = PLAYFAB_TITLE_ID;
request.CustomId = playerId;
request.CreateAccount = false;


PlayFabClientAPI.LoginWithCustomID(request, OnLoginSuccess, OnLoginError, parameters);


And here are the results I get:

InfoResultPayload object is null when it shouldn't be.

I have tried to disable the compression for API data (PlayFabSettings.CompressApiData = false;) but it doesn't help.

Is there something I missed setting up or is this a bug?

login-results.png (100.5 KiB)
1 comment
10 |1200

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

hp avatar image hp commented ·

Forgot to mention that we are using Unity 5.3 and PlayFab SDK v2.10.161003.

0 Likes 0 ·
hp avatar image
hp answered

Now that I slept on it I can see what I did wrong there.

GetPlayerCombinedInfoRequestParams parameters = new GetPlayerCombinedInfoRequestParams(){
   GetUserAccountInfo = true,
   GetPlayerStatistics = true
};
   
LoginWithCustomIDRequest request = new LoginWithCustomIDRequest()
{
   TitleId = PLAYFAB_TITLE_ID,
   CustomId = playerId,
   CreateAccount = true,
   InfoRequestParameters = parameters // This is the correct place to assign parameters
};

PlayFabClientAPI.LoginWithCustomID(request, OnLoginSuccess, OnLoginError /* I tried to assing parameters as customData */);

So I just didn't assign GetPlayerCombinedInfoRequestParams to correct place.

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

That actually should be returning InvalidParams, as the InfoRequestParameters is required. Can you update the body of the call to this?

{
  "InfoRequestParameters": {
    "GetUserAccountInfo": true,
    "GetPlayerStatistics": true
  }
}
10 |1200

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

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.