粉丝页面上的权限 [英] Permissions on fan page

查看:122
本文介绍了粉丝页面上的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获得我在粉丝页面标签上拥有的应用程序的许可并停留在当前标签上?

How do I get permission on an application I have on a fan page tab and stay on the current tab?

我很好地收集了对应用程序的权限,但是当我将应用程序放在选项卡上时,它似乎陷入了永无止境的循环中,而且从未到过任何地方.

I am collecting permissions on the application fine, but when I put the application onto a tab, it goes haywire seemingly getting caught in a never-ending loop and never going anywhere.

推荐答案

您可以使用JavaScript SDK来做到这一点:

You could do this with the JavaScript SDK:

//Facebook connection with the JavaScript SDK
FB.init({
    appId: 'YOURAPPID', 
    cookie: true, 
    xfbml: true, 
    status: true });

FB.getLoginStatus(function (response) {
    //If you have permissions already
    if (response.session) {
        //Do application stuff...
    } 
    else {
        //Redirect browser to the permission dialogue
        top.location="https://www.facebook.com/connect/uiserver.php?app_id=YOURAPPID&method=permissions.request&display=page&next=REDIRECTPAGEURI&response_type=token&fbconnect=1&perms=email,read_stream,publish_stream,offline_access";
    }
});

您在fb.init函数中放入了应用程序ID,然后调整权限对话框的重定向,以便它包括您的应用程序ID,用户接受权限对话框后要重定向到的URI,以及最后要获得的权限(在这种情况下,我包括电子邮件,阅读流,发布流和脱机访问令牌).

You put in your application ID in the fb.init function, and then adjust the redirect for the permissions dialogue so it includes your application ID, the URI you want to re-direct to after the user accepts the permission dialogue, and finally the permissions you want to get (in this case I included email, read stream, publish stream and offline access token).

这篇关于粉丝页面上的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆