-2

I am trying to get the users additional information like gender, birthdate, email, and hometown. I am using this code below:

$user = Socialite::driver('facebook')->fields([
                    'first_name', 'last_name', 'email', 'gender', 'birthday', 'location'
            ])->scopes([
                'email', 'user_birthday', 'location'
            ])->user();

But my problem for now is it is not getting the user location or hometown, sometimes, it also failed to fetch the users' gender and birthday. How can I access the users' data without using the App review in Facebook for developers.

Eem Jee
  • 1,239
  • 5
  • 30
  • 64
  • Before you get your app reviewed, you can only ask people with a role in your app for those permissions. (And there is no permission named `location`.) – 04FS Mar 08 '19 at 12:20
  • @04FS Yes. We are the only one accessing it. We are admin of the app. I also have tried `hometown` but is not working. – Eem Jee Mar 08 '19 at 13:05
  • 1
    why would you "try" stuff, intead of taking a look at the docs? they tell you exactly what permissions there are, and what fields. – andyrandy Mar 08 '19 at 13:10

1 Answers1

0

https://developers.facebook.com/docs/facebook-login/permissions

The permissions would be user_hometown and user_location, according to the docs.

https://developers.facebook.com/docs/graph-api/reference/user

The fields would be hometown and location.

andyrandy
  • 72,880
  • 8
  • 113
  • 130