Frage

I am trying to implement a login with Facebook - thus far all is working, apart from the $user data I am being returned does not include the username (which I know does exist).

The array I am being returned is the following (with details purged):

Array ( [id] => ################ [email] => #.########@#####.co.uk [first_name] => ######## [gender] => male [last_name] => ######## [link] => https://www.facebook.com/app_scoped_user_id/################/ [locale] => en_GB [name] => ######## ######## [timezone] => 1 [updated_time] => 2014-05-06T21:23:33+0000 [verified] => 1 )

Has anyone had experience of this before?

War es hilfreich?

Lösung

The username field was removed in version 2.0 of the graph API. I'm not aware of any workaround (short of using version 1.0).

This change is listed in the "Removed Endpoints" section of the upgrade guide. You can also see that the "User" reference contains no mention of a username field for version 2.0, but does for version 1.0.

Not all fields are available through the API. You can see exactly what fields are available using the references I've provided above.

Andere Tipps

Looks like a Facebook Graph API bug.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top