Thanks in advance.
How can I track facebook logout, when user is not on my facebook application? I've offline_access permission from my app user.
I am developing a facebook app, in which I want to show to other my app user that which (my app) user is login on facebook at this particular time.
You have no way of knowing what the user is up to when he's not in your application.
You have 2 options:
(1) Ask for the "user_online_presence" permission from the user, then check what's his status using a fql like this:
SELECT uid, name, online_presence FROM user WHERE uid=me();
(Take a look at the result in the Graph API Explorer)
(2) You can use the Chat API to connect the user to the xmpp, then you get presence messages for all of his online friends, and that can help you to maintain the online presence of a users friends.
Related
I develop a Facebook application where i implemented the login with Facebook accounts using "https://graph.facebook.com/me?fields=id,first_name,last_name,email,picture&access_token=xxxxxx" end point from the Facebook API. With the data receive to the Facebook I created an user in my database where I can login with this.
Now, I must will get all the users Facebook which use the my Facebook application. There are a Facebook end point where i can receive from the API all the users Facebook in the JSON format ?
Thank you !!
Now, I must will get all the users Facebook which use the my Facebook application. There are a Facebook end point where i can receive from the API all the users Facebook in the JSON format ?
No, there is not. You only get user ids when they log in – to store them appropriately for whatever purpose you need them for, is your responsibility.
I'm developing an web application in Java and using facebook account for login to my applications. After sucessfull login i need to get the logged in facebook account user friend's details including email id's. I can get the logged in user's friend's profile details but not the email ids of them. It always shows null. How do i get the email ids of my facebook friends.
Any help is very much appreciated.
Currently, this is not supported by Facebook. You cannot get user's friends' email, regardless of what permissions the user gives your app. Refer to the this for details.
Is there any way to get the Facebook User Id of visitors in my website by using the FB API, but without need to ask them to authenticate my Facebook app?
All I need is some facebook-related-identifier, it does not even have to be the User Id, but any kind of identifier that can relate the user to a facebook profile.
Ideas?
If the user does not explicitly authorize you to get some private data from his Facebook account (included his Facebook ID), you can not get them.
I cannot think of a way to get the Facebook ID without the authorization of the user.
Hope that helps.
we are working on a web site that getting users' friends and users' feeds. Users can register via facebook connect. but we want to take user's feeds at any time. is that possible ? can we take feed information from facebook without user login.
You will have to take the permission from user for offline_access, only then you can get his feeds.
This would be very bad. There are users that have their feed on public, but generally, the user has to give explicit confirmation to allow you to use their feed.
how can i get a facebook user's info like name, country, etc without making him login using fb connect, etc if i already know his facebook id?
I mean can i use the php facebook client to get those details without prompting for login if i already know the facebook id?
Thanks in advance :)
You can't get that information with just a facebook id unless the person who the information belongs to made that information public (which almost noone has).
The only solution I see is to ask your users for the extended permission "offline_access".
As far as I know you can only do this from within a facebook application or through the Facebook Connect javascript library (so not with the PHP library for instance).
This means that you will have to ask users to login at facebook through fb:connect atleast once, ask for offline access and store the facebook sessionKey in your local database.
Because you have offline access now, the facebook sessionKey won't expire and you can login serverside without the user being present.
This is how I implemented the php server side after attaining the permanent session:
$this->fb = new Facebook($settings["api_key"], $settings["secret"], false, true);
$this->fb->user = $facebookUserId;
$this->fb->api_client->session_key = $sessionKey;
$this->fb->api_client->set_user($facebookUserId);
The only other way to get a private users information is if you have an application and that user has given it access. Then you can snatch up any data using a FQL query.
$facebook->api_client->fql_query(
"SELECT first_name, last_name, location
FROM user
WHERE uid={$userid},
AND is_app_user;"
);