-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FCL login with Facebook fails #57
Comments
@codesman - ah, thank you! This one had puzzled me, so I hope this is the solution. The app I created for the screencast is still set to the v2.0 API version, which allows the API calls to be made to this version. If you create a new app, it likely sets the minimum version to the latest version of the API. @bocharsky-bw Could you update the code (I think it's the step // before
$json = $facebook->api('/me');
// after
$json = $facebook->api('/me?fields=email,first_name,last_name'); I just confirmed that this works. We should also probably add a note. Thanks! |
Easy win for me! We haven't smart code blocks for this tutorial. @weaverryan Could you merge it if looks good? |
In response to comments on this page: https://knpuniversity.com/screencast/oauth/facebook2
This caught me up as well. The call to
$facebook->api('/me')
only returns 2 fields,'id'
and'name'
even with'publish_actions'
and'email'
permissions on the app. What the cluck?!According to this post http://stackoverflow.com/questions/32584850/facebook-js-sdks-fb-api-me-method-doesnt-return-the-fields-i-expect-in-gra as of v2.4, there has been a change in the api and it no longer returns all of the fields that it used to by default, you must explicitly request the fields you want.
FCL login with Facebook would not work for me until I changed the api call to
$facebook->api('/me?fields=email,first_name,last_name')
This returns an array with 4 fields,['email','first_name','last_name','id']
Eggs-cellent course Ryan & Leanna, thanks a bunch!
Tom
The text was updated successfully, but these errors were encountered: