简体   繁体   中英

facebook connect login, request permission to different fields

I am trying to request permission to user data with the code but this line of code only works if the user is already authorised.

$user_profile = $facebook->api('/me?fields=id,name,timezone,location,email');

But its only showing the id and name as its only requesting User basic information.

I have added the option in the app under User & Friend Permissions: with email, But this did not help.

How do i request permission for this?

I only need this as i want to match up users facebook id to their email address in my user table.

Thanks

If the email column is bot being returned, there could be an issue with your access token. Run your access token thru: https://developers.facebook.com/tools/debug to see if it really does have access to the email column. Also you can use https://developers.facebook.com/tools/explorer to run Graph API queries directly, this tool has saved me tonnes of time! Good luck.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM