Search Unity

[Tutorial] Facebook SDK Integration in Unity

Discussion in 'Community Learning & Teaching' started by Jojo-Batista, Jun 4, 2014.

  1. Jojo-Batista

    Jojo-Batista

    Joined:
    Dec 5, 2012
    Posts:
    32
    Hello Folks! We are doing a series of posts to help the community on the difficult task of integrating Facebook using their Facebook SDK.

    I'll try to keep you posted on this link so you can check them out when we create new posts, or you could follow us on our blog if you want to as well :)

    Facebook Integration in Unity:
    1. Integrating Achievements http://www.bigfootgaming.net/blog/tutorials/integrate-facebook-achievements-in-unity/
    2. Creating Custom Open Graph Objects http://www.bigfootgaming.net/blog/tutorials/facebook-open-graph-objects-in-unity3d/
    3. Canvas Payments http://www.bigfootgaming.net/blog/tutorials/facebook-canvas-payments-in-unity3d/

    Also, we are currently working on a plugin, but I won't give you much details since is in a really early stage :)

    Hope this helps you!!

    Leave us a comment below if you want us to talk about an specific topic

    Update April 2015: We recovered our blog! The blog is up again, and of course the posts as well. Only payments missing, will be up really soon
    Update April 2015 2: Just added canvas payments again
     
    Last edited: Apr 18, 2015
  2. Jojo-Batista

    Jojo-Batista

    Joined:
    Dec 5, 2012
    Posts:
    32
  3. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Any update on leader boards?
     
  4. Jojo-Batista

    Jojo-Batista

    Joined:
    Dec 5, 2012
    Posts:
    32
    Funny you asked that, because we are currently working on how to do one!
    Since we want to add it for our game, we are currently writing a guide while we do so.
    Expect it to come in about a week, maybe two if we can't find the time to do it.
    If you have some specific question feel free to email us at gaming.bigfoot@gmail.com or nicolasmbatista@gmail.com
    Thanks!
     
  5. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Thanks!
     
  6. Wolfranium

    Wolfranium

    Joined:
    Dec 25, 2014
    Posts:
    3
    Hey Jojo . I tried to click on your links, but I'm getting errors. Not sure if its from my side.

    If I may ask your help, I'm trying to integrate Facebook's SDK into our game and for some reason my programmer is having a hard time doing it (he's Czech so his English isn't great, and he's not a Facebook guy, so I think the documents are confusing him, and I honestly don't understand their documentation much myself since I'm not a programmer). What I'm trying is:

    1. To have the players compete against their Facebook friends by showing their scores/ranks at the end of every game.
    2. Give them the ability to boast either through the newsfeed or a personal message (if there's a better way, kindly please let me know).
    3. Also, I would like to connect the like button in our game to our Facebook page if possible (basically if they like our game through the button we make, it would like our Facebook page). I'm not sure this one is possible though, but I'm curious.

    Sorry for the many requests, but we've been stuck for a while now, and any help would be much appreciated. Thank you very much. :)
     
  7. Jojo-Batista

    Jojo-Batista

    Joined:
    Dec 5, 2012
    Posts:
    32
    Hello Wolf, we are having troubles with our hosting, so we are rebuilding the web. I can give you the rough copy of our tutorials and see if it clears some doubts :) I'll get on it on monday!
    As for the questions:
    1. Facebook has leaderboards that work similar to the google play and game center leaderboards. Then you have to make an api call to facebook and retrieve the users id and the leaderboard scores. If you want to show his friends pictures you can get their images with the id as well.
    2. The leaderboard triggers a facebook post if a user beats another user's score automatically. If you want of course, you can as well let them share their score on facebook in their newsfeed.
    3. You can't create a like button, you can only redirect them to your page and then they have to click like through facebook (This is to avoid false buttons that could make the user like stuff without knowing about it)

    As for the details, I don't have any code right now, we've been working on a leaderboard tutorial, that should be ready soon, but with this website issue we couldn't post it yet :(
     
    Wolfranium likes this.
  8. Wolfranium

    Wolfranium

    Joined:
    Dec 25, 2014
    Posts:
    3
    Thanks a LOT jojo :D !! Your current answers alone are great to help me know how to sort out the GUI and inform my programmer what I expect from him. I very much look forward to your tutorials bro ;) *thumbs up* !!

    & HAPPY NEW YEAR GUYS !!!!
     
    Last edited: Dec 30, 2014
  9. Wolfranium

    Wolfranium

    Joined:
    Dec 25, 2014
    Posts:
    3
    Hey Jojo, hope your hosting troubles are sorted bro. Do you guys happen to have a youtube channel? :)
     
  10. Onsterion

    Onsterion

    Joined:
    Feb 21, 2014
    Posts:
    215
    Very interesting, works with Unity 5 Beta?
     
  11. piserajm

    piserajm

    Joined:
    Aug 13, 2012
    Posts:
    1
    Hello,
    Some time ago I read your documents but now the links are broken.
    They can be found elsewhere?

    thank you very much
     
  12. gamersden

    gamersden

    Joined:
    Nov 18, 2014
    Posts:
    8
  13. yashpal

    yashpal

    Joined:
    Jul 18, 2014
    Posts:
    14

    hello @Jojo Batista ,

    I try the link but it dose not working.
    Can you just re-post it. I am just looking for this.
    I read a documentation of facebook but i can't get any idea how to custom-facebook-open-graph-objects-unity3d.

    - Yashpal Javia
     
  14. Jojo-Batista

    Jojo-Batista

    Joined:
    Dec 5, 2012
    Posts:
    32
    We are currently working on getting the site up and running again :) Will be up soon. You can subscribe to our newslettter here: www.bigfootgaming.net
     
    Wolfranium and yashpal like this.
  15. Jojo-Batista

    Jojo-Batista

    Joined:
    Dec 5, 2012
    Posts:
    32
    For all who asked, we just recovered our blog again, and with a new website :D so you can check the tutorials back again. Thanks for all who reported the links broken, and sorry for the inconvenience.
    PS: Payments will be up soon, we are still working on the post recovery
     
  16. Jojo-Batista

    Jojo-Batista

    Joined:
    Dec 5, 2012
    Posts:
    32
    Canvas payment is back again. Let us know what feature would you like us to explore next.
     
  17. Abhijit-Mukherjee

    Abhijit-Mukherjee

    Joined:
    Jan 9, 2015
    Posts:
    193
    Good Job My friend ... Your post is like life saver ..Keep it up .
     
  18. Abhijit-Mukherjee

    Abhijit-Mukherjee

    Joined:
    Jan 9, 2015
    Posts:
    193
    One thinG I need to know . How can we know how many user is playing the game in Facebook
     
  19. deiva

    deiva

    Joined:
    Jul 12, 2016
    Posts:
    16
    When i implement the score API in iOS build the game crashed But in android it works. Any solution for it.
    For IOS we should any thing setting changes in editor or in build.
     
  20. JoystickLab

    JoystickLab

    Joined:
    Mar 18, 2016
    Posts:
    14
    Hey, What is the call back Url in facebook payment? I don't understand this? any help?
     
  21. Saddamjit_Singh

    Saddamjit_Singh

    Joined:
    Dec 4, 2015
    Posts:
    22
    Hi,

    I am also trying to create an open graph object from unity. I am using the code below-

    public void ObjectManagement()
    {
    var formDict = new Dictionary<string, string>()
    {
    {"title", "AskForCoins"},
    {"type", "product.item"},
    {"image", "http://ecx.images-amazon.com/images/I/314leP6WviL._SL500_AA300_.jpg"},
    {"description", "Classic cold war technothriller"},
    {"app_id", FB.AppId.ToString()}
    };
    var formData = new Dictionary<string, string>() { { "object", Facebook.MiniJSON.Json.Serialize(formDict) } };
    Debug.LogError (formDict.Values);
    FB.API("/me?objects/product.item", HttpMethod.POST, CreateFBLifeCallback, formData);
    }
    public void CreateFBLifeCallback(IGraphResult result)
    {
    if (!string.IsNullOrEmpty(result.Error))
    {
    Debug.LogError("Error during object create call! " + result.Error);
    }
    else if (FB.IsLoggedIn)
    {
    Debug.LogError("ok during object create call! " + result);

    }
    }
     
  22. zero_null

    zero_null

    Joined:
    Mar 11, 2014
    Posts:
    159
    Hello Big Foot !
    Can you please kindly tell what can be done as the open graph objects are deprecated and can't be used.