I know there have been numerous questions regarding Facebook's policies in which we can store information into our application's database. I have looked at Storing Facebook API data and also have looked at https://developers.facebook.com/policy/ but I just want to ensure that I am not violating Facebook's terms of use. I want to store a user's objectID in order to get certain information about them for use on another screen on my application (namely their profile picture) into my database. I was wondering, is that considered okay? I have looked around and haven't seen anything explicitly speaking about storing a user's objectID so I just wanted to confirm this would be okay. If this is not okay, would any one have any suggestions on how I can get a specific user's profile picture? Thanks!
I believe for Facebook's API things like a user's object ID is actually just an ID for that user for specifically your application. Meaning, you have a unique ID for a user that is completely different than the ID that Facebook uses internally or that another application has for the same user. So unless I terribly misunderstand, you can and should store that.
Related
I want to create an iPhone app that displays (among other things) a specific Facebook wall. For a good user experience I didn't want an app that required the user to have a Facebook account and I didn't want to force the user to have to log in to Facebook to see the latest "news" in the app. I started out by getting the wall RSS feed and tried parsing it ... I can "see" all the data I need ... but that is getting complicated quickly and has too many variables that are making the final results less than stellar. I have read through the Facebook iOS programming tutorials and it seems to me like the SDK forces the user log in, which I don't like.
My question ... Is there a way to use the Facebook SDK with hard coded profile credentials to access a specific wall without forcing the user to login? If possible, is that a recommended approach? Any other ways to skin this cat?
I have read through the Facebook tutorial and searched through many postings on this site but haven't found an answer to this ... sorry if this a newbie question and has already been answered.
Item I.2. of the Facebook API policy list says
You must not include functionality that proxies, requests or collects
Facebook usernames or passwords.
It sounds to me like that's what you're proposing to do; i.e., the user will be able to see a certain wall, but using hard coded credentials (not their own). In other words, your credentials are proxying for the user.
I do not know if it is technically possible to do this (I imagine it is) but I don't think it's a good idea, and I do think it's a violation of the Facebook API terms of service.
First you need to get the a access_token by parsing your app id and secret.
https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET
Then send following request to get the data you want. Note that only public data will be accessible.
https://graph.facebook.com/FACEBOOK_USER_ID/?access_token=ACCESS_TOKEN
I created a Facebook app(game) in JavaScript. I used Facebook's php-sdk. I dint make a good use of the sdk except to display the name of the user logged, and his details.
I want to store the score of each user at some place. Checked FQL. As far as I saw, it doesnt allow you to store data, there was only SELECT query available. So is there any way in which we can append the score to user information or something similar.
In short can we store the data on Facebook
OR
We should use our own database server only to store the data.
In general you need to store your own data. While it might be possible to fake it by using some attribute of a user, it's certainly not the way it's designed to work and you can't count on the data always being available. You are better off setting up your own database and use the users' FB IDs to tie the info together.
Facebook now supports posting scores via scores api found here.
You can also publish achievements relevant to the game as in here
These have enough guidance to help you out !
When it comes to integrating your site with facebook, is it recommended to save all the user's info from Facebook to your DB, or is it recommended to query in real time all the info you need based on the user's id?
For example the avatar sizes are different on my site than on my facebook, so I may have no choice but to download the fb avatar, but for other things like name, gender, hometown, I was wondering if I need to save that data.
Also, if I decide to change extended permissions at a later time, is that going to be an easy task?
The choice of whether to cache or re-query is totally dependent on your requirements. If you absolutely need the name to be exact then you should re-query every time. I worked on an facebook application that just didn't care about most user details so we didn't even store them let alone cache them.
Extending permissions is pretty easy.
I want to get a list of all users (even if they are my friends or not) who are using my facebook application. Is this possible? If so, how?
And another quick question if we're still here :) Assue I have a facebook id of a person, can I retrieve his name by using it?
I don't believe that you can get a list of all the Facebook IDs of users of a particular application. There doesn't appear to be a possible query for this based on an examination of the FQL tables, probably due to performance and privacy reasons. Generally the presumption is that you maintain a local list of users in your own application, and correlate them to Facebook via their ID, so you would already have all these IDs.
To answer your second question though, yes, that is definitely possible. The Facebook API provides both the users.getStandardInfo and the users.getInfo methods, both of which take user Ids and return information about the user, including the name. users.getInfo can even be used without a session key to just get the name of the user.
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
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