I've a facebook app at which I've asked users to give their email, work Info etc. The users have already granted the permission to retrieve these information.
Now I want to retrieve their phone numbers also but I've not asked for it previously.
So how do I ask the already authenticated users to give access to their phone numbers?? Is their some code which I can add and next time they logged in, they are prompted to authenticate that extra info??
You can call FB.login again but specify the permissions you want to request for this time with scope. Example below, where you are requesting publish_stream:
FB.login(function(response) {
if (response.authResponse) {
// user gave permission
} else {
// user did not give permission
}
}, {scope:'publish_stream'});
You can also use FB.ui with method set to 'permissions.request'
See http://fbdevwiki.com/wiki/FB.ui#method:_.27permissions.request.27
You need to send in the "extra" permissions the same way you got the initial ones. When your user hits the URL it will open up the same "permissions" box on FB that they were originally present with, but only with the new requested permissions set. They'll go through the same process of accepting or declining, then they'll come back to your site.
Edit: Make sure you add the same permissions you asked for originally, or FB will remove those original ones.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With