Search Unity

Unity iPhone and Facebook connectivity

Discussion in 'iOS and tvOS' started by xcoder, Dec 22, 2009.

  1. xcoder

    xcoder

    Joined:
    Sep 26, 2009
    Posts:
    7
    Hi All,

    I am developing a multi-player game in Unity iPhone. I want to connect my application to the Facebook. Also I want to do the data transfer using Facebook. Currently I have no idea about Facebook connectivity in Unity iPhone. Please any one guide me regarding this.

    Thanks In Advance.
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Unity iPhone does not offer any facebook connectivity

    but there are at least a handfull of threads on the topic that should get you going
     
  3. minevr

    minevr

    Joined:
    Mar 4, 2008
    Posts:
    1,018
    May be use "Unity iPhone enhancement pack"... :D
     
  4. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    Facebook connectivity on the web is driven by content (Unity games for example) communicating with JavaScript contained in the web page, that JavaScript is what then sends/receives data from Facebook (using the current browser's login session to determine who you are). Given that on the iPhone you're building stand-alone applications that's no longer present and thus the connectivity isn't there.

    Minevr jokes, but perhaps there's some way to go about that. I don't know of one, but there may be some non-JavaScript API set available as even Facebook made an iPhone app, do they expose those hooks at all? I don't know, I'm doubtful in fact, but they might so it may be worth a look.
     
  5. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    It's no joke, Tom! There's a Facebook Connect SDK for iPhone developers that you can download: http://wiki.developers.facebook.com/index.php/Facebook_Connect_for_iPhone

    The upcoming Enhancement Pack 1.5 uses it to provide these functions:

    Code (csharp):
    1. void SB_facebookStart( string apiKey_str, string myAppSecret_str );
    2. void SB_facebookGetPermission( string perm_str );
    3. void SB_facebookSetStatus (string status_str);
    4. void SB_facebookPublishFeed( string prompt_str, string feed_str, string action_str);
    5. void SB_facebookLogout();
    I've used it to make wall postings (complete with a screenshot, text and a buy-now action link). I haven't written any docs for these functions yet, but if you're familiar with the Facebook API in general it's pretty straightforward.

    And Dreamora's right, there's various past threads that show ways to use the FaceBook API from Unity. Like this one: http://forum.unity3d.com/viewtopic.php?t=20469
     
  6. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    Dang Rob, you rock!

    Thanks for yet another awesome tweak to the iPhone Enhancement Kit!

    And to you and Dreamora for shedding light in my apparently dark(ish) world. :)


     
  7. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    Dear bliprob:

    I'd like to use Facebook feature of your "Unity iPhone Enhancement pack", but I have some questions for this pack, would you please be so kind to answer me?

    Thank you. :wink:

    Q:

    1. How can I get the pack? I see the "BUY" link on your web site, but what would happen when I paid money? It will redirect me to download code? Or I have to wait your personal reply and tell me where to download? (I am sorry we are hurry to use that feature.)

    2. If I only want to use Facebook feature, is it possible to buy this part only?

    Sincerely,
     
  8. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    I wonder when would Unity-iPhone add on Facebook support feature?
     
  9. 1r0nM0nkey

    1r0nM0nkey

    Joined:
    Apr 8, 2009
    Posts:
    131