facebook developer test user get relationship status - facebook

I'm trying to retrieve the relationship_status of my test user in my facebook app.
The status is set to Single on the webpage, and can be accessed by public.
But the api call:
me?fields=id,name,relationship_status
returns nothing for relationship_status
What am i doing wrong?

Related

Facebook test user create page

I am creating an app that uses facebook location information when a user creates a status update with a location (check in). In order to do this with a test user I need to be able to create a fake page, but there seems to be a bug in facebook code where a test user cannot create a page. The City/State field is always shown as invalid even when I enter valid information. Is there any way to use test accounts to test status updates with location?

Do i need the Facebook PHP SDK for Page Tab Apps?

I'm developing a Facebook Page Tab App. The files are located on my own server and i've created a Facebook App.
Now i'm trying to access the user's first name and i found different ways to get user informations, e.g. the $signedrequest (for the user ID) or the Facebook PHP SDK.
So do i need the SDK, e.g. for Graph API calls, or are there other ways to get informations from Facebook in my Page Tab App?
Using the SDK i get a lot of errors like An active access token must be used to query information about the current user., even if the user is already logged in.
If the user have not signed in to your app you will not get the user name or user id from the singend request parameter. It will give you information if the user likes the page, is admin of the page and additional app_data.
Using the php-sdk you can use the getLoginUrl() method, https://developers.facebook.com/docs/reference/php/facebook-getLoginUrl/, to get the access token needed to fetch user name, user id etc.

Using FQL to retrieve facebook status's of all users who are using My Facebook Application

I would like to retrieve status's of all users who are using my Facebook application.
I am not interested in retrieving the user's friends statuses only interested in retrieving the users who are using my Facebook application and have granted my application the "read_stream" permission.
I can successfully retrieve status's of the logged in user or one of the logged in user's friends by calling:
SELECT post_id, message, attachment, type FROM stream WHERE source_id = "SOME ID" AND type IN (46, 247)
But that is not my goal. I would like to get "All" users who are using my Facebook application and get their latest status feed without any particular user being logged in.
For example: I am not logged in facebook now neither or you. But when you click the link below you will get an RSS Feed of this particular user. This user is actually a business page so it is open to the public. Click This Link
I would like to retrieve this information from users who allow my application "read stream" permissions.
I cannot retrieve this information on personal Facebook user pages. So I am under the impression I need to build a Facebook Application to do so.
There is no way to retrieve a list of the user IDs of your app's users, and if you already have the user IDs you already have the correct query format - you just use the access token from the users to make that call
The fact you can't retrieve a list is covered here: Facebook. How to get list of all users of my app?
If you need the status updates of all your users, you should probably be using the Realtime Updates API to get a notification sent to your app when the user adds a new message, you can then use a cached [and still valid] access token for that user to retrieve the new messages

Graph API for user returns false even with a valid user access token

About 2% of the time, a user authorizes my Facebook App and with a valid access token, I call Facebook's Graph API only to get back the value "false" instead of a JSON representation of user information. For example:
https://graph.facebook.com/{user_id}?access_token={user_access_token}
--> returns "false"
I can't seem to reproduce the problem myself. My problem may be related to this answer:
http://facebook.stackoverflow.com/questions/5085957/facebook-graph-api-returns-false-for-page-accounts/6595465#6595465
but I can't access my App when I'm logged in as a Page as the answer above suggests, so I have no way to verify whether my problem is the same or not.
Any suggestions?
UPDATE (2011-09-29)
It turns out that this problem happens whenever a user does not have a completed profile. You can reproduce this problem by first logging out of Facebook then creating a Facebook Page here:
http://www.facebook.com/pages/create.php
During the Page creation process, Facebook will ask you to log in with an existing account or create a new one. If you create a new one, Facebook will create a user account for you, but the user account will not have a completed Profile. So instead of Facebook's API providing the information they do have about the user (i.e. the info that it collected during the sign-up process), it returns false. Once the user "Creates a Profile", then Facebook's API will return the proper user graph.
The 'false' return almost always means you're trying to access a piece of content that the current user (or page, app, etc depending on your access_token) has no permission to view.
If you're definitely calling /{user_id}, with a user access token, it's most likely that either the user has Platform disabled, or the user has the session user blocked.
Facebook returns JSON representation of data for a {user_id} (as per your usage) when that user id is either a Profile ID, App Id or Page ID
false is returned when it is neither of the three.. There is something wrong with the {user_id} that you are using. You should log the ids for which you get this error and try making a graph call to then like http://graph.facebook.com/{user_id}.. if this again returns false you will be sure of the fact that it is a wrong id ,,

Getting a user's ID using Facebook's Graph API

Is it possible to get the ID (Facebook Graph API) of a user who is currently logged in, without any access tokens?
If not, then how do I get new access tokens every time a user visits my page?
You will need to init the Facebook Javascript SDK and the user will have to have authorized your app at least one time. After that when the user visits your page as long as they are logged into Facebook you'll have access to the id and can retrieve it using
FB.getLoginStatus
the response will contain the information you're looking for.
Check this blog post for more details on setting up the FB init and the initial login.
https://developers.facebook.com/blog/post/525/
You can check the facebook ID using their username
http://graph.facebook.com/radrivan
You can use the javascript sdk to get their accesstoken and let them allow your app.
https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.2