views:

24

answers:

1

Hi, I am working on a web site that lets members sign up for classes... and I'd like to implement Facebook Connect in some way so that when someone enrolls in a class, it can pop up a window and say "hey, 12 of your friends are also enrolled!" and show the friends.

I know this is possible, but in looking at the Facebook Connect docs, it's a bit confusing about how to do it.

I don't need specific code or anything like that... but I'd love a general sense of how to do this, or even some rough meta code.

So the answer I'm looking for would be something similar to: "first you need to authenticate the user by calling this facebook api call (link), then that will return their ID, which you need to keep in your app's local database... then you give facebook a list of all the IDs you know, and facebook will build a list of their friends that match, by using this api call (link)" etc...

I just need enough so I can see "the big picture" and then start to actually write some code and string all the pieces together. Facebook has great API docs but sometimes the context of the calls (i.e. WHEN I would use certain calls, and under what circumstances, like this!) is pretty vague.

thanks-- E

+1  A: 

Quite simply, once the user has authenticated your application, you store the user's ID in your database. When user is logged in via Connect, you can use Friends.getAppUsers to return a list of users who have also authenticated the application and are also the authenticated user's friends. You could then compare those IDs with the IDs in your database table that stores user IDs and associates them with class IDs (I'm assuming each Class has an ID/table).

Check out the overview on providing social context in the documentation for more: http://wiki.developers.facebook.com/index.php/Connect/Providing_Social_Context

Typeoneerror
Thanks very much-- this is exactly what I needed.
Eric

related questions