c# - JsonConvert.DeserializeObject from PubNub message -


When I send this message to MakeAction manually, it works and the message box pops up:

But when I Pu Message from bNub does not work:

  Display static zero Subscribe to Return message (String result) {// Message receives PubNub takes care of action MessageToAction MTA = New MessageToAction (); MTA.MakeAction (results);}  

PubNub's message is slightly different than one manually created:

  [[\ "Action \": \ "turncompleted \", \ "MessageId \": \ "123123123 \", \ "playerID \": \ "100000067174580 \", \ "round \": 1, \ "answer \ ": [[\" Longitude \ ": 21.0 9, 375, \" axis ¼ "24.527134822598}, {\" longitude \ ": 1.40625, \" latitude \ ": 23.885837699862}]}, \" 13926740640746402 \ ", \" sugar-jeffcity \ "]  

I tried to remove the bracket and slashed the text but then the pulses around the "value" values ​​were also changed.

I was wondering what I am doing wrong here?

There is also an action class:

  class action {[JasonProperty ("Action")] public string action {get; Set; } [Jasonproporty ("Message ID")] Public String MessageID {get; Set; } [Jasonproperty ("GameID")] Received Public String Game ID; Set; } [Jasonproperty ("ElevationFacebookID")] Public String Explorer FacesbookID {Received; Set; } [Jasonproperty ("GMTip")] Public String GMATIFE {Received; Set; } [Jasonproperty ("Number of Players")] {Get the public string number offplayer; Set; } // public list & lt; String & gt; Longitude (get; set;} // public list & lt; string & gt; latitude {get; set;} // public list & lt; string & gt; value {get; set;} [jasonproporty (" Player ")] Public list & gt; players & gt; players {receive; set;} // must be empty and removed! [Jasonproperty (" Price ")] Public list & lt; value & gt; value ; Set;} public action () {}} class player {// player [Jess Public String Player ID {Received; Set;} [Jasonproperty ("Facebook Id")] Public String facebookID {get; set;}} class value {// answer [jasonproperty ("longitude")] Public String Longitude {Receive; Set;} [Jasonproperty ("Latitude")] Public String Latitude {Received;    

Instead of offering you the improvement, I will use that. Please note that the sample Jason you posted is not valid. I'm removing this part; \ "13926740640746402 \", \ "chinese-jefecito \"] and the action array of items closed You are not able to have keys in JSN (both are without keys) and they are in the array instead of the object, anyway, I am using this Jason;

: 1, \ "answer \": [{"longitude"]: 21.0 9, 375, \ "latitude \": 24.5271348225 9 8} {\ "longitude \": 1.40,625, \ "latitude \ ": 23.885837699862}]}]

  public class action {public string action {get; Set; } Public string messageID {get; Set; } Public string round {get; Set; } Public Answer [] Answer {get; Set; } Public class response {public string longitude (get; set;} public string latitude {get; set;}} action [] action = jason convert. Diaryialize object  (jssostring);  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -