javascript - facebook fbml login-button not working with perms - Stack Overflow

I recently ran into a problem when I upgraded to the new php and js sdkbefore the login button below wo

I recently ran into a problem when I upgraded to the new php and js sdk

before the login button below worked fine, and the dialog box popped up for a user to grant permission.

<fb:login-button perms="email,user_about_me,user_interests,user_location,publish_stream,read_stream,offline_access,publish_checkins">Connect Facebooks</fb:login-button>

Now the dialog won't pop up, but if I take out the "perms" and use this button

<fb:login-button">Connect Facebook</fb:login-button>

the dialog does pop up. any ideas?

I recently ran into a problem when I upgraded to the new php and js sdk

before the login button below worked fine, and the dialog box popped up for a user to grant permission.

<fb:login-button perms="email,user_about_me,user_interests,user_location,publish_stream,read_stream,offline_access,publish_checkins">Connect Facebooks</fb:login-button>

Now the dialog won't pop up, but if I take out the "perms" and use this button

<fb:login-button">Connect Facebook</fb:login-button>

the dialog does pop up. any ideas?

Share Improve this question asked Aug 10, 2011 at 22:50 Clint C.Clint C. 68813 silver badges33 bronze badges 5
  • I can't replicate this (in Google Chrome). Is it affecting a particular browser? – Ben Regenspan Commented Aug 11, 2011 at 0:41
  • Hi Ben, I'm using google chrome also. I'm upgrading to the new oauth 2.0, it was fine before i upgraded =/ – Clint C. Commented Aug 11, 2011 at 1:57
  • Ah - then it appears that you're a victim of this bug, currently being triaged: bugs.developers.facebook/show_bug.cgi?id=19733 – Ben Regenspan Commented Aug 11, 2011 at 3:24
  • That would be exactly it. Not much I can do until Facebook fixes the issue I guess right? – Clint C. Commented Aug 11, 2011 at 3:41
  • Added an answer with a workaround – Ben Regenspan Commented Aug 11, 2011 at 4:02
Add a ment  | 

1 Answer 1

Reset to default 7

Update: The bug causing this issue was resolved, so your best option is to use <fb:login-button> still, but change "perms" to "scope" to match the latest API changes:

<fb:login-button
    scope="email, user_about_me, user_interests, user_location,
    publish_stream, read_stream, offline_access, publish_checkins">
    Connect Facebooks
</fb:login-button>

If you're still seeing issues after that or want an alternative login button style: there's actually nothing very special about <fb:login-button>, it's just an easy way to render a login button, which is (mostly) a thing that calls FB.login() when clicked. You can make your own login button with just a little bit more work by doing something like:

<a id="fb_login_button" href="#" 
      onclick="FB.login(function(){ /* this is a callback function */ },
      {scope: 'email, user_about_me, user_interests, user_location,
       publish_stream, read_stream, offline_access, publish_checkins'});
       return false;">
    <img src="LOGIN_BUTTON_IMAGE.png" alt="Log In with Facebook">
</a>

Where the login button image is any image or text (you could even use a screenshot of the one rendered by <fb:login-button>).

(note: inline onclick used here so this is library-independent, not implying it's a good practice to do so)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742287489a4415585.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信