1
votes

I am learning how to use the Facebook Scores API for a Facebook Canvas game made in Unity. I have read Facebook's online documentation and require code examples of how to query and sort friends scores from the Scores API. Can you recommend a link to such code examples?

My specific goal: The game's score screen will display 3 scores, retrieved from Facebook's Score API:

  1. my friends high score who has the next highest score compared to my score.
  2. my high score.
  3. my friends high score who has the next lowest score compared to my score.

Thank you.

1

1 Answers

1
votes

The facebook API will help you build a leaderboard: Scores API

The Facebook Unity Game Tutorial will help setup your project. Please don't forget to test it outside the Editor: enter link description here

I have also found very useful the sample that comes with the Facebook SDK for Unity. Sadly this is my first post and I can't give you more than two links.

Since the Facebook API call will return the list of the logged user's friends that have also authorized the game in descending order, you will need to manually iterate through to grab what you are looking for.