Search Unity

Facebook Friends Leaderboard

Discussion in 'Android' started by Luca91, May 31, 2013.

  1. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    I've searched a lot, but I haven't found anything relevant.
    Many new mobile games have a Facebook Friends Leaderboard (like ie. Subway Surfers).
    Is possible to achieve this with Unity3D ? and how ? I need some hint to find the right direction.

    Many Thanks.
     
  2. Lukas H

    Lukas H

    Joined:
    Jan 16, 2009
    Posts:
    394
    Its posible but it wll cost you some time and struggling. First you need to get acces to facebook inside Unity, I would recommand Prime31 Social plugin. Also, you need to create an app on facebook, Prime's tutorial will tell you how to do that. Next to need to let the user using sign in. Then you need to figure out which facebook calls you need to get those leaderboards. For that you need to digg through the facebook api which is bit of a beast.

    Hopefully this will get you started
     
  3. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    I've talked to some expert and now I've the solution:

    Create a database that will record the higger Score + facebook id of the player + his name
    Using a facebook integration plugin get all the ids of the facebook user's friends and compare them with the ids in the database
    and voilà here is the friend's leaderboard ;)


    EDIT: just one consideration: I don't know if with Prime31 plugin you can grab all your facebok friends IDs !
     
    Last edited: Jun 2, 2013
    lifeisfunxyz likes this.
  4. akkiDev

    akkiDev

    Joined:
    Aug 7, 2013
    Posts:
    70
    Hi,
    If i understood you want to integrate your Fb friends in your leaderboard.
    Yeah it is possible to integrate your Fb friends but you need a database or lots of custom code just have a look to this it will provide you all the relevant information or help you to integrate your Fb friends and making a leaderboard in your app by few lines of code and you dont need to worry about backend support.

    FaceBook Friends LeaderBoard

    for more details just click on the url given below, let me know if you have any query.
    http://api.shephertz.com/app42-dev/unity3d-backend-apis.php
     
    Last edited: Sep 30, 2013
  5. StevenMCH

    StevenMCH

    Joined:
    Feb 15, 2014
    Posts:
    16
    Is there another solution/tutorial without using the example above? Really need help in this.
     
  6. sandeepsmartest

    sandeepsmartest

    Joined:
    Nov 7, 2012
    Posts:
    139
    please help guys...at least is there any site to store the high scores???like the below site for game maker
    http://gmscoreboard.com/
    i just want to send the name of the player , his score and to retrieve list of high scores that were stored in the cloud..can anyone help me???
     
  7. akkiDev

    akkiDev

    Joined:
    Aug 7, 2013
    Posts:
    70
  8. serioustommy

    serioustommy

    Joined:
    Jun 12, 2012
    Posts:
    126
    It's surprising that no one has suggested using the facebook Score API.

    Since you want to attach a score to a facebook user it makes sense to just use the facebook's Score API which is free and can be used to populate a leaderboard in your game.

    Take a look here:
    https://developers.facebook.com/docs/games/scores/

    You could easily query the list of scores using Prime31's plugin, or you could use the free Unity plugin provided by facebook here:
    https://developers.facebook.com/docs/unity/

    Note that using the facebook plugin requires manually doing http get and post to interface with the Graph API, whereas Prime's plugin provided some wrappers to simplify the score API.

    A very useful benefit of using facebook API is that any score update will potentially appear on the facebook timeline automatically, which is obviously good for the game's virality.
     
    satanas and Shibli like this.
  9. StevenMCH

    StevenMCH

    Joined:
    Feb 15, 2014
    Posts:
    16
    I solved my problem now, but I realise there's no 'easy mode' to set up a Facebook Leaderboard, even with all those plugins, which are not centered on implementing leaderboards. I eventually outsourced the job to a programmer specialised in online integration and multiplayer so I could focus on other tasks.

    After going through all that trouble, I then packaged the relevant scripts I use, wrote a guide, and made it into a plugin to help others :) It was approved on the Asset Store just over a month ago: https://www.assetstore.unity3d.com/en/#!/content/17803

    Some features:
    ~Leaderboard based on users' Facebook friends
    ~Real-time next highest rank (displayed at a corner in-game)
    ~Invite friends
    ~Post to timeline (scores, image and text)​
     
    Last edited: Jul 12, 2014
  10. akkiDev

    akkiDev

    Joined:
    Aug 7, 2013
    Posts:
    70
  11. sowatnow

    sowatnow

    Joined:
    Jun 12, 2014
    Posts:
    309
    HIi
    I bought your asset, but there is no instruction about how to create a board in game. The instruction provided is only for online setup.. not in game.
    Do you have instruction for how to setup a leaderboard in game?
     
  12. ViicEsquivel

    ViicEsquivel

    Joined:
    Sep 23, 2014
    Posts:
    7
    Hi,
    Do you have some sample code on how to implement the FB.API(get) and FB.API(post) includding the deserialzier for the FBResult?? Im having a
    400 Bad Request
    UnityEngine.WWW:get_text()
    everytime I try to read the information requested.

    Im doing this:
    FB.API("/ --FB App ID-- /scores?fields=score", Facebook.HttpMethod.GET, LeaderboardCallback);

    void LeaderboardCallback(FBResult response){
    Debug.Log (response.Text);
    }
     
  13. CodePin

    CodePin

    Joined:
    Aug 11, 2014
    Posts:
    7
  14. gamersden

    gamersden

    Joined:
    Nov 18, 2014
    Posts:
    8
  15. StevenMCH

    StevenMCH

    Joined:
    Feb 15, 2014
    Posts:
    16
    A lot has changed since then. :)

    Major update 2.0 was just approved and went live as of March 2015, and most scripts have been re-written and re-commented for much easier understanding. All Facebook SDKs updated to latest too.

    I also added a comprehensive "FAQ and Solution" section based on the support emails that I have solved throughout the 8 months since the initial release!

    Plugin now has 4 stars based on 15 reviews ;) https://www.assetstore.unity3d.com/en/#!/content/17803
     
  16. marzat

    marzat

    Joined:
    Apr 19, 2015
    Posts:
    1
    StevenMCH, is this plugin working in Unity 5.0?
     
  17. maxgreen

    maxgreen

    Joined:
    Oct 13, 2012
    Posts:
    8
    I recommend trying SOOMLA's social leaderboard. I'm using it and very happy with its simple API, plus the fact that it's completely free of charge
     
  18. ercion

    ercion

    Joined:
    Aug 15, 2016
    Posts:
    73
    Facebook has launched its Unity SDK. Download form here, it has the leaderboard you were looking for :)
     
  19. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38
    Hello friends, maybe anybody knows, how to make this: Feature to see FRIENDS GAME PROGRESSION like in Saga.. How they did it? In saga we can see friends progression just after the LOGIN TO FB, without any other permissions..

     
    zero_null likes this.
  20. zero_null

    zero_null

    Joined:
    Mar 11, 2014
    Posts:
    159
    It's not Score API from Facebook. They have created a whole backend for this purpose that they are using for almost all of their games.
     
  21. karthik888

    karthik888

    Joined:
    Nov 8, 2021
    Posts:
    6
    Hey I think by now you know how to make an fb leaderboard, could u help me creating it suggesting with a tutorial or any other means?