开发者

Facebooker Rails - fb_login_button can't set perms

开发者 https://www.devze.com 2023-02-10 11:27 出处:网络
Hey all, im using facebooker gem to connect to facebook. Its all working fine except the fact that i cant set which perms i want user to allow.

Hey all, im using facebooker gem to connect to facebook. Its all working fine except the fact that i cant set which perms i want user to allow.

Although i pass the offline_access permission, when the popup opens, it show only the basic info permissions.

Code from my view

<%= fb_connect_javascript_tag %>
<%= init_fb_connect "XFBML"%>
<%= fb_login_button("window.location = 'some_url';", :perms => "offline_access")%>

generates

<script src="http://static.ak.connect.fac开发者_如何学Goebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<script type="text/javascript">

         Event.observe(window,'load', function() {
            FB_RequireFeatures(["XFBML"], function() {
              FB.init('myapikey','/xd_receiver.html', {});

            });
          });

</script>
<fb:login-button onlogin="window.location = 'http://localhost:3000/users/show';" permissions="offline_access"></fb:login-button>


I think the attribute needs to be "perms" rather than "permissions"?

http://developers.facebook.com/docs/reference/plugins/login/


This will not work. You need to pass the permissions with init_fb_connect like

init_fb_connect "XFBML", { :js => :jquery, :app_settings => " { permsToRequestOnConnect : 'status_update,user_events' }" }
0

精彩评论

暂无评论...
验证码 换一张
取 消