I'm making a game where I can link the user account with Facebook. So far so good, but I need a value that identifies the Facebook user, as the name, but that is unique. So I thought of user name that is unique per account. But I found no information in the Facebook documents that show how to get this information. Does anyone know how I can get this? And it is not the name that the user puts in his profile, it is the username.
The best way to do this (and the best way to store) is by the use of User IDs. Facebook allows you to do this.
User: https://developers.facebook.com/docs/graph-api/reference/user/
I personally don't use Facebook API but from experience you would use an User ID.
Related
I'm looking to set up the Facebook Audiences API into my PC game but I'm a bit confused about how Facebook matches this to a real-world user.
I don't collect any user data in my game other than a unique userID. If I use the "External Identifiers" example in the FB documentation and push the userID back to Facebook, how does FB then match this to a Facebook user? Do they just collect IP address from the payload and use the userID to find a unique user or something else?
Thanks in advance.
Unless players of your game can use their facebook accounts to create user id's for your game, it is unlikely that you will be able to create audiences based on this data. Facebook isn't interested in the usernames of people who play your games, they would have no reason to store this information.
One thing you could do is allow players to create an account by signing in with their facebook id. This would let you put them on an advertising list, without having to try to match up user names to a game that facebook doesn't know about.
Here's a link to a quick start for Facebook Connect, which would allow you to do what I detailed above.
https://developers.facebook.com/docs/javascript/quickstart
Did I miss sth or it is impossible to get link to user's timeline from Facebook Messenger API?
According to: https://developers.facebook.com/docs/messenger-platform/user-profile User Profile API doesn't return link in fields.
Is there any other option?
You would have to use the User Profile endpoint and use all the information for determining which Facebook user it matches to. If you image match the profile picture and match all the other information, and compare timezone to their location, it is probably possible, but it's probably not easy.
Making a workaround like this might not be a bad idea because Facebook seems to want to keep all the stuff seperate right now, as their user ID's are different for seemingly everything. The User Profile endpoint exists for personalization purposes, but it doesn't identify a user.
The user matching through login might also be useful as a outside of messenger solution, but I'm not sure exactly how that would be done.
I am building a web app that will retrieve basic Facebook user information, among them also the profile photo, via
https://graph.facebook.com/USERNAME/picture?width=100&height=100
I plan on storing that variable in my database so that I can display the profile photos in the web app.
Now, I'm wondering what happens when someone changes their Facebook username from "jimmysmith" to "jamesdoe", for example? I assume that my saved URL of
https://graph.facebook.com/JIMMYSMITH/picture?width=100&height=100
will stop working? Is there any way around this?
Or will it still work because Facebook redirects the old username to the new username, maybe? I found no evidence of that, however. I have no way of testing it, either.
The way I retrieve it via FQL is:
$fql = "select uid, name, email, birthday from user wher.... etc.
Use the user IDs instead.
Usernames will not be query-able in v2.0 API.
See https://developers.facebook.com/docs/apps/upgrading for more information.
I'd like to know if it is possible to get userid or email for all people with same first name by using FQL and API. I mean all people with first name, like Mary, they don't have be my friends or fans. Thanks.
Not possible.
FB user must give you permission to query their account information. Until then, you can't get any information on them (so of course, you can't query every FB user named Mary).
No. You can't do that.
As Simon said FB user must give you permission to query their account information. An APP can access information for only those users, who have given that permission to the APP.
For example, the apps that you have mentioned in comment, social lead freak etc. will only show the results for those users which have given permission to that particular app. This means that there can be thousands of users on Facebook with the first name "Marry", but out of those thousands of users, only around 200 are using that APP (that is, have given permissions to access their data). Hope that explains the why they are doing that partially.
When enabling Facebook Connect, any facebook user can then login to your website,
what type of user profile information can my website retrieve?
Username?
Email?
First Name?
Last Name?
There is a ton of information you can retrieve, if the user has permitted it through their privacy settings. Just about everything you can retrieve is in a FQL table somewhere:
http://wiki.developers.facebook.com/index.php/FQL_Tables
You cannot, however, get their email. You need to ask permission, using the API, to do that. This is also not a data bonanza, you can only permanently store the user ID. Everything else you can only store for 24 hours, then need to re-query Facebook for the information.
If you just want to display the user's first and last name, you can use FBML rendered with the Facebook Connect code.
http://wiki.developers.facebook.com/index.php/FBML
Khou,
There are seriously loads of API docs around.
Good luck on your facebook journey ;)