0

The FriendSmash sample is kind of hard to follow and i was wondering if anybody had just a simple way to retrieve these using the Unity Facebook SDK?

Im pretty sure i have to use the QueryScores and ScoresCallback methods. Not sure how though.

Basically i need a way to iterate through the list of friends and retrieve each of their names, scores, and profile pictures.

Thank you!

Steven
  • 166,672
  • 24
  • 332
  • 435
Red Titan
  • 31
  • 1
  • 3

1 Answers1

1

The graph explorer is a great way to explore and see how you can fetch names, scores and profiles: https://developers.facebook.com/tools/explorer/

The commands you put in there would be the same ones that goes into FB.API(). The JSON response should also be the same.

Brian Jew
  • 906
  • 5
  • 5
  • Im not having trouble with the HTML GET. I need help getting the data out. I dont know how to iterate through the list of objects and obtain specific information per a friend and store it in each label. – Red Titan Mar 04 '14 at 04:53
  • The data you get back is a JSON string. You just need a JSON deserializer to turn it into a dictionary or object and iterate over that. – Brian Jew Mar 04 '14 at 19:55
  • Thanks a lot! i completely missed this method! private int getScoreFromEntry(object obj) { Dictionary entry = (Dictionary) obj; return Convert.ToInt32(entry["score"]); } – Red Titan Mar 06 '14 at 07:29