HI Guys! I used These Codes In my Project It Save data successfully
void SetUserData() { PlayFabClientAPI.UpdateUserData(new UpdateUserDataRequest() { Data = new Dictionary<string, string>() { {"Ancestor", "That Good Number One"}, {"Successor", "Keep It Up You Are Second"} } }, result => Debug.Log("Successfully updated user data"), error => { Debug.Log("Got error setting user data Ancestor to Arthur"); Debug.Log(error.GenerateErrorReport()); }); }
But When I want Retrieve data back it through error : HTTP/1.1 400 Bad Request
here is getuserdata code
void GetUserData() { PlayFabClientAPI.GetUserData(new GetUserDataRequest() { PlayFabId = "C1536", Keys = null }, result => { Debug.Log("Got user data:"); if (result.Data == null || !result.Data.ContainsKey("Ancestor")) Debug.Log("No Ancestor"); else Debug.Log("Ancestor: " + result.Data["Ancestor"].Value); }, (error) => { Debug.Log("Got error retrieving user data:"); Debug.Log(error.GenerateErrorReport()); }); }
My Title id: C1536
error log
Got error retrieving user data: UnityEngine.Debug:Log(Object) <>c:<GetUserData>b__32_1(PlayFabError) (at Assets/Scripts/Assembly-CSharp/GameManager.cs:214) PlayFab.Internal.PlayFabUnityHttp:OnError(String, CallRequestContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:275) PlayFab.Internal.<Post>d__12:MoveNext() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:161) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
/Client/GetUserData: HTTP/1.1 400 Bad Request UnityEngine.Debug:Log(Object) <>c:<GetUserData>b__32_1(PlayFabError) (at Assets/Scripts/Assembly-CSharp/GameManager.cs:215) PlayFab.Internal.PlayFabUnityHttp:OnError(String, CallRequestContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:275) PlayFab.Internal.<Post>d__12:MoveNext() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:161) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)