• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Mat Brummitt · Jan 24, 2010 at 12:11 PM · iphonefacebookleaderboard

(Unity iPhone) Help With Online Leaderboard Using Facebook Connect

Hi all,

I looked on the forum and nobody seems to have addressed this issue...

I want my game to have an online leaderboard utilising facebook connect so that I can show a player how he has scored compared with his facebook friends. I'm unsure of how to start implementing this within Unity.

I realise that i'll need to create a page or two on the web server in PHP to handle database inserts to store the high scores and user facebook id's, and also to make wall posts for users (informing friends of their new high score, as well as notifying other friends who play the game that their score has been beaten).

What I don't know how to do is add the facebook connect bit within Unity that will allow me to access a user's facebook data (friends list, profile pic etc), or how to submit a piece of data to the web server to store a user's score against their facebook ID... I also don't know how I go about getting the high scores INTO unity from the server? I was assuming i'd just have to have Unity goto a webpage in the background (www.domain.com/mygame/getscores.php?playerID=###) and this page would return a load of XML which unity would parse and then I have my scores ready to output into a nice looking leaderboard... I guess what i'm asking, is how you get Unity to make a server request?

Sorry this Q is a bit wordy, but hopefully someone can help.

Thanks

Mat

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Brian-Kehrer · Jan 24, 2010 at 05:27 PM

AFAIK facebook connect doesn't let you access user data from server requests, you have to actually visit (or embed) their javascript based login system thing, specifically to prevent automatic access of data. Take a look at their API - If there is a way to connect using server requests, I'd love to see it.

Here is the Objective-C iPhone facebook connect system Facebook Connect iPhone

To answer your question, I hope:

The Unity API classes you need to get and post data are WWW and WWWForm

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by Ontario Britton · Mar 12, 2010 at 03:30 PM

I wrote a blog post yesterday on getting facebook connect working in a unity game, with sample code from start to finish. I was also thinking about how it would lead into a leaderboard system. That would be something good to add in an upcoming post.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · May 22, 2012 at 04:08 AM 0
Share

Hi, this blog link is broken :/

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Facebook leaderboard issue 0 Answers

How we create multiple leaderboard of facebook without using any other server? 1 Answer

Prime31 Facebook login failing if logged into facebook through settings 1 Answer

Regarding Facebook Friends Profile Pictures. 0 Answers

Posting an image with a link using Prime31 Social Networking plugin 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges