Facebook JS SDK demanding too many permissions

I have a Facebook tab set up to ask for permission for the users email - this works fine, but the dialog that comes up says ' Appname would like to access your public profile, friend list and email address. '

This will lower participation for the app - I don't want the public profile or friend list.

Code is as follows, with fake appId:

 var useremail;
    window.fbAsyncInit = function() {
        FB.init({
            appId: '01234567890', 
            cookie: true, 
            xfbml: true,
            oauth: true
        });
        FB.login(function(response) {
            if (response.authResponse) {
                FB.api('/me', function(response) {
              useremail=response.email;
              //Do stuff
                });
            } else {
                //No access
            }
        },{scope: 'email'});
    };
    (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
        document.getElementById('fb-root').appendChild(e);
    }());

Even if I remove the email scope request, it still claims I am after the user's public profile and friend list. Not had this issue before, it used to show the friendly customisable dialog that you can preview in the Apps>Settings>Permissions area.

I can't find any other setting that could have caused this. Any ideas, thanks in advance...


I'm marking this as answered, the issue is covered at http://www.insidefacebook.com/2012/12/12/how-changes-to-facebooks-app-auth-process-affect-developers/

In short, in the permissions dialog shown when logging on via the Javascript SDK Facebook have renamed 'Basic info' to 'Public profile and friend list'.

We're reverting to having a manually filled email field on the Facebook competitions we do, it will probably result in more participation than being forced to throw such an ominous sounding dialog in visitors faces and having people rightfully say 'no thanks'.


Do you see the

FB.api('/me', function(response) {

line? Replace /me with /email and that should work.

I got this from the Graph API.

链接地址: http://www.djcxy.com/p/83138.html

上一篇: Facebook连接:如何强制发布

下一篇: Facebook JS SDK要求太多权限