The "old" Facebook Graph API had a "username" field which could be used to create a human-readable profile URL. My username for example is "sebastian.trug" which results in a Facebook profile URL http://www.facebook.com/sebastian.trug.
With Graph API 2.0 Facebook has removed the "username" field from the user data as retrieved from "/me".
Is there any way to get this data via the 2.0 API or is the "username" now being treated as a deprecated field?
The simplest way to get a copy of the User Profile object is to access the /me endpoint: FB. api('/me', function(response) { }); This will this will return the users name and an ID by default.
You can get user data by using the Facebook Graph API if the user has given their permission to share their data and your app has the appropriate permissions to receive this data. This topic shows you how to make a single request for data and how to have a batch of requests in a single request.
So here is the complete step by step tutorial for Android Get Facebook Login User Information Using Graph API Android Studio Example Tutorial. 1. Create a fresh project in Android Studio. 2. After done creating project open developers.facebook.com . 3. Login with your Facebook ID. 4. After successfully login Click on Create App button. 5.
Apps using older versions of the API can get this field until January 8, 2019. Apps installed by the User on or after May 1st, 2018, cannot get this field. A token that is the same across a business's apps.
Login with your Facebook ID. 4. After successfully login Click on Create App button. 5. Enter Application display name and your contact email address . Then click on Create App ID . 6. At front of Facebook Login click on Get Started. 7.
App ids used by the users being uploaded. This field is required when schema is a Facebook UID and the IDs were collected by an App integration. e.g. [1234,5678] Page ids used by the users being uploaded. This field is required when schema is a Facebook UID and the IDs were collected by a Page webhook integration. e.g. [1234,5678]
Facebook got rid of the username because the username is one way of sending emails via Facebook.
For example, given the url http://www.facebook.com/sebastian.trug
the corresponding Facebook email would be [email protected]
which, if emailed, would be received to messages
directly (if the message
setting is set to public
), otherwise to the other
inbox.
The username
field of the User object has been removed, and does not exist in Graph API v2.0. In v2.0 of the API is there is no way to get the FB username of a user.
Source: https://developers.facebook.com/docs/apps/changelog#v2_0_graph_api
"/me/username is no longer available."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With