iDevGames Forums
Saving scores for facebook users to compare with their friends - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: Saving scores for facebook users to compare with their friends (/thread-9330.html)



Saving scores for facebook users to compare with their friends - roguekiwi - Sep 12, 2011 07:09 PM

I am looking for a way (similar to what Doodle Jump has) where a user of my game can log in to facebook using facebook connect, submit their high score (to somewhere) and see what their friends high scores are.

Is there any tool, service or API currently available to do this? or would I have to roll my own backend and server to store and retrieve this information?

Cheers!
Eli


RE: Saving scores for facebook users to compare with their friends - ThemsAllTook - Sep 13, 2011 05:55 AM

This is a good place to start, in case you haven't been to it already: http://developers.facebook.com/docs/

There isn't a storage API, so you'll need your own back end to store high scores keyed by Facebook user ID. With the proper authentication, you can retrieve a list of the user's friends using the graph API, which you could then use to look up scores for them on your server.


RE: Saving scores for facebook users to compare with their friends - roguekiwi - Sep 13, 2011 07:41 PM

Cheers..I thought that would be the case. I might write up a blog post about it when i'm done Smile


RE: Saving scores for facebook users to compare with their friends - AndyKorth - Sep 13, 2011 08:22 PM

There are dozens of libraries by other people.

Here's one I randomly picked out of this list: http://www.google.com/search?q=ios+facebook+connect

https://github.com/facebook/facebook-ios-sdk

I think we've used a Unity plugin once... or at least recommended it to someone.

On one iOS project it looks like we did use FBConnect.bundle, which appears to be supplied by facebook, but like Alex says, there's a little bit of stuff to store client side, not really an issue though..


RE: Saving scores for facebook users to compare with their friends - roguekiwi - Sep 13, 2011 09:01 PM

Yeah i'll definately be using FBConnect to get the facebook user's information and friends, but the point is to store my custom score data against each facebook user, so that when somebody is playing my game and wants to compare their scores and achievements with their friends who are also playing, that score data needs to be stored somewhere, which can't be local, it needs to be on a database somewhere where all instances of the game can access it and see if their friends have uploaded scores. And as ThemsAllTook said, theres nowhere to store that data with facebook itself, so it seems i'll need my own server/database.

(Sep 13, 2011 08:22 PM)AndyKorth Wrote:  There are dozens of libraries by other people.

Here's one I randomly picked out of this list: http://www.google.com/search?q=ios+facebook+connect

https://github.com/facebook/facebook-ios-sdk

I think we've used a Unity plugin once... or at least recommended it to someone.

On one iOS project it looks like we did use FBConnect.bundle, which appears to be supplied by facebook, but like Alex says, there's a little bit of stuff to store client side, not really an issue though..