Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
1 capture
14 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by Jean-Pierre-DP · Apr 11, 2016 at 01:22 PM · facebook

Facebook.MiniJSON Deserialize comments and nested values under from returning no values.

Good day,

We are using a FB.API call to retrieve the comments on a post, we are unable to retrieve the data nested under "from".

API Explorer command: "10153539873517828/comments?"

C# code

 FB.API("/10153539873517828/comments?", HttpMethod.GET, delegate (IGraphResult result)
                {
             string jsonMessage = result.RawResult;
             Debug.Log(jsonMessage);
             var soap = Json.Deserialize(jsonMessage) as Dictionary<string,object>;
             List<object> entries = soap["data"] as List<object>;
             
             try
             {
                 for (int i = 0; i < soap.Count; i++)
                 {
                     Dictionary<string,object> messageData = entries[i] as Dictionary<string,object>;
                     object resultData = messageData["message"];             (Works)
                     object resultData = messageData["name"];                  (Blank)
                     Debug.Log("JSON string : " + resultData.ToString());
                 }
             }
             catch
             {
                 Debug.Log("Done!!!");
             }
         });

JSON String:

 {
   "data": [
     {
       "created_time": "2016-03-31T11:10:18+0000",
       "from": {
         "name": "Hello world",
         "id": "298062736962722"
       },
       "message": "Test comment",
       "id": "10153539873517828_10153539875377828"
     },
     {
       "created_time": "2016-03-31T11:12:47+0000",
       "from": {
         "name": "Hello world",
         "id": "298062736962722"
       },
       "message": "people must be wonder what the bleep is this, lol.",
       "id": "10153539873517828_10153539877202828"
     }
   ],
   "paging": {
     "cursors": {
       "before": "WTI5dGJXVnVkRjlqZAFhKemIzSTZANVEF4TlRNMU16azROelV6TnpjNE1qZAzZANVFExT1RReU1qWXhPQT09",
       "after": "WTI5dGJXVnVkRjlqZAFhKemIzSTZANVEF4TlRNMU16azROemN5TURJNE1qZAzZANVFExT1RReU1qYzJOdz09"
     }
   }
 }

We can successfully get the "message" and "id" under "data" when trying to get the "name" and the associated "id" it returns blank values.

We have read many post and had a look at some of the solution people have posted and we have not found anything that has helped to resolve the issue.

As we are using the FB SDK it would stand to reason that we should be able to use the Facebook.MiniJSON to deserialize the above string. Retrieving:

      {
        "created_time": "2016-03-31T11:10:18+0000",
        "from": {
          "name": "Hello world",
          "id": "298062736962722"
        },
        "message": "Test comment",
        "id": "10153539873517828_10153539875377828"
      },

 

All the example on the developer documentation only cover first level retrieval, how can we fix this?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Jean-Pierre-DP · Apr 12, 2016 at 04:20 PM

Hi

Found a solution, looks like it is not possible using Facebook.miniJSON

https://www.assetstore.unity3d.com/en/#!/content/710

Able to access all values using the above plugin.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Jean-Pierre-DP · Apr 13, 2016 at 09:03 AM 0
Share

Hi

Found a solution that works with Facebook.$$anonymous$$iJSON

link: stackoverflow.com/questions/36567866/facebook-$$anonymous$$ijson-deserialize-comments-and-nested-values-under-from-returning-no/36575027#36575027

big thank you to $$anonymous$$Brzozowski

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

54 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Hi gang! Facebook SDK error (unity / Facebook api up to date) Could not securely load assembly from https://integrated-plugin-canvas-rsrc.fbsbx.com/rsrc/unity/lib/sdk_6.2/CanvasFacebook.dll 0 Answers

Facebook for Windows 1 Answer

Failed to repackage resources 1 Answer

Facebook SDK - iOS - Doesn't return user data 1 Answer

About AndroidSupportLibraryResolver.cs 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges