Sign In Register

How can we help you today?

Start a new topic
Answered

response not returning DisplayName

Hi, im using this piece of code from the unity tutorials and its not returning the Display Name request.


 

new AccountDetailsRequest().Send((response) =>
		                                 {
UpdateGUI(response.DisplayName,response.UserId,response.Currency1.ToString());
});

 and on the debug console this is the output of the response...



GS: RECV:{"@class":".AccountDetailsResponse","currency1":200,"currency2":0,"currency3":0,"currency4":0,"currency5":0,"currency6":0,"location":{"latitide":personalinfo,"longditute":personalinfo,"city":"personalinfo","country":"personalinfo"},"requestId":"635522047178254380_3","scriptData":null,"userId":"546aee2fe4b0c1a676d7208e"}



am i missing something, casue the currency is showning up and so is the userId but not displayname


thnx


Cheers,


Best Answer

I am really very sorry about that!


Can you try the following:


   

	new AccountDetailsRequest().Send((deetResponse) =>
	{
		Debug.Log(deetResponse.DisplayName);
	}); 

 

For me it returned the following:


 

GS: RECV:{"@class":".AccountDetailsResponse","currency1":1000,"currency2":0,"currency3":0,"currency4":0,"currency5":0,"currency6":0,"displayName":"Shane1","location":{"latitide":53.202805,"longditute":-6.098297,"city":"Bray","country":"IE"},"requestId":"635525227222016393_2","scriptData":null,"userId":"5474912ae4b07ef8b3c7427a"}

 

 

  

Shane1
UnityEngine.Debug:Log(Object)
TestScene:<OnGUI>m__F(AccountDetailsResponse) (at Assets/Scripts/TestScene.cs:70)
GameSparks.Core.<Send>c__AnonStorey7:<>m__61(GSObject)
GameSparks.Core.<Complete>c__AnonStoreyB:<>m__67()
GameSparksUnity:Update() (at Assets/GameSparks/GameSparksUnity.cs:46)

 

What version of the Unity SDK are you using?


You could try doing just a Debug.Log(response.Currency1.ToString()) in the resposne to see if it's working correctly as UpdateGUI assumes the GUI is set up correctly.


Shane

Uhm.... i think it i mentioned the problem being with the display name and NOT currency. And the fact that its not even showing in the response debug details as i have shown


Thnx for your prompt reply and careful attention to mater.


Cheers,

Answer

I am really very sorry about that!


Can you try the following:


   

	new AccountDetailsRequest().Send((deetResponse) =>
	{
		Debug.Log(deetResponse.DisplayName);
	}); 

 

For me it returned the following:


 

GS: RECV:{"@class":".AccountDetailsResponse","currency1":1000,"currency2":0,"currency3":0,"currency4":0,"currency5":0,"currency6":0,"displayName":"Shane1","location":{"latitide":53.202805,"longditute":-6.098297,"city":"Bray","country":"IE"},"requestId":"635525227222016393_2","scriptData":null,"userId":"5474912ae4b07ef8b3c7427a"}

 

 

  

Shane1
UnityEngine.Debug:Log(Object)
TestScene:<OnGUI>m__F(AccountDetailsResponse) (at Assets/Scripts/TestScene.cs:70)
GameSparks.Core.<Send>c__AnonStorey7:<>m__61(GSObject)
GameSparks.Core.<Complete>c__AnonStoreyB:<>m__67()
GameSparksUnity:Update() (at Assets/GameSparks/GameSparksUnity.cs:46)

 

What version of the Unity SDK are you using?

Hi GameSparks support, any answer on why response.DisplayName is not in JSON string? I am getting the same response occasionally.


Login to post a comment