Reputation: 1413
how to request user permissions using facebook api in js? I want to let people login my site using facebook login. then I want to request facebook datas from the visitor. now I can get datas like this using js
FB.api('/100005658545226?fields=id,name,email') =>
{
"id": "100005658545226",
"name": "Mingfish Lin"
}
but there is no email info in the response json, so I want to send a request to ask user to authorize this email permission . how can I do this job in js? such as what does bellow.
Upvotes: 1
Views: 806
Reputation: 751
Call the login method with a callback and an options object with an array as the scope property, such as:
FB.login(callback, {scope: ['email']});
More info at Facebook Permissions
Upvotes: 3