question

Dorijan Hrdavec avatar image
Dorijan Hrdavec asked

I have problems sending the player information to the servers of Playfab using unity android

Error :

Data updated error Invalid input parameters System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.List`1[System.String]]

Code IS Here 


 UpdateUserDataRequest userDataRequest = new UpdateUserDataRequest(); 

        userDataRequest.Data = data;

        userDataRequest.Permission = UserDataPermission.Public; 

        PlayFabClientAPI.UpdateUserData(userDataRequest, (result1) => {

        Debug.Log("Data updated successfull "); 

        

        }, (error1) => 

        { 

        Debug.Log("Data updated error " +error1.ErrorMessage+ error1.ErrorDetails); 

        }, null); 



        }
apisPlayer Dataunity3dandroid
10 |1200

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

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

Hi Dorijan,

I’ve done some tests regarding this, it looks like the issue resides in the “data” variable you passed to userDataRequest.Data in line 7. Please note that the keys are limited in size, and may not begin with a '!' character or be null: https://github.com/PlayFab/UnitySDK/blob/ee3f9b97b0c6f910ce43b889b2742e071ebc6c97/Source/PlayFabSDK/Client/PlayFabClientModels.cs#L6155.

And, it would be helpful for us to troubleshoot if you can provide the exact “data” variable you passed to userDataRequest.Data when you encountered the error, thanks.

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.

Dorijan Hrdavec avatar image Dorijan Hrdavec commented ·

Hello @Citrus Yan ,

how much limit API string size? i have send 78000 character long string in client API, and not begin with a '!' and null. i have check JSON will valid and not use any special character in API.

thank.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Dorijan Hrdavec commented ·

Hello @Dorijan Hrdavec ,

I tested sending 78000 characters and 10000 characters long string value for the key "Class", the error details for "78000 characters" says "The value for key Class was 78000 bytes and exceeded allowed length 10000 bytes." and the "10000 characters" test worked just fine. Therefore, API string size for UpdateUserData API is 10000 characters, with each character takes up 1 byte.

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.