rev_dev_01
rev_dev_01

Reputation: 540

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...

Upvotes: 4

Views: 1052

Answers (2)

rev_dev_01
rev_dev_01

Reputation: 540

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'.

Upvotes: 3

nikobradshaw
nikobradshaw

Reputation: 47

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.

Upvotes: 0

Related Questions