facebook fan gate只能使用管理员帐号Javascript [英] facebook fan gate only work with admin account Javascript

查看:134
本文介绍了facebook fan gate只能使用管理员帐号Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Facebook应用程序(iframe应用程序)中有一个Facebook风扇门,但只有在使用管理员帐户登录时才可以使用。当我正常用户测试没有沙箱模式的应用程序时,他们会被困在不喜欢的部分,但他们是粉丝。
我已经检查了页面ID,这是正确的。
感谢您的帮助

  FB.getLoginStatus(function(response){
if(response.status = ='connected'){
var user_id = response.authResponse.userID;
var page_id =[pageid];
var fql_query =SELECT uid FROM page_fan WHERE page_id =+ page_id +和uid =+ user_id;
var the_query = FB.Data.query(fql_query);

the_query.wait(function(rows){

if(rows.length == 1&& rows [0] .uid == user_id){
$(#container)。show();
$(#container_notlike) .hide();
$(#notloggedin)hide();
alert(用户喜欢页面)

}

else {
$(#container_notlike)。show();
$(#container)。hide ;
$(#notloggedin)。hide();
alert(User not like page)
login();
}
});
} else {
$(#container_notlike)。hide();
$(#container)。hide();

$(#notloggedin)。show();

login();

}
});

}
init();


解决方案

从评论来看,似乎你的登录代码实际上并不是要求 user_likes 许可,您需要检查页面是否被没有完全公开的用户喜欢



Re:评论中的另一个问题,请参阅< a href =https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/ =nofollow> https://developers.facebook.com/docs/reference/javascript/FB .Event.subscribe / - 订阅edge.create回调,当点击相似按钮时,您会收到通知。


I have a facebook fan gate in my facebook app (iframe app), but it's only working when logged in with the administrator account. When i was testing the app without sandbox mode with normal users they get stuck in the not fan section, but they are fans. I have checked the page ID, it's correct. Thanks for help

        FB.getLoginStatus(function (response) {
            if (response.status == 'connected') {
                var user_id = response.authResponse.userID;
                var page_id = "[pageid]"; 
                var fql_query = "SELECT uid FROM page_fan WHERE page_id =" + page_id + " and uid=" + user_id;
                var the_query = FB.Data.query(fql_query);

                the_query.wait(function (rows) {

                    if (rows.length == 1 && rows[0].uid == user_id) {
                        $("#container").show();
                        $("#container_notlike").hide();
                        $("#notloggedin").hide();
                        alert("User like page")

                    }

                    else {
                        $("#container_notlike").show();
                        $("#container").hide();
                        $("#notloggedin").hide();
                        alert("User NOT like page")
                        login();
                    }
                });
            } else {
                $("#container_notlike").hide();
                $("#container").hide();

                $("#notloggedin").show();

                login();

            }
        });

    }
    init();

解决方案

From the comments, it seems your Login code wasn't actually asking for the user_likes permission which you'll need to check if the page is liked by users who don't have completely Public likes

Re: the other question in the comments, see https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/ - subscribe to the edge.create callback and you'll be notified when the like button is clicked

这篇关于facebook fan gate只能使用管理员帐号Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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