Facebook App问题 - 无法获取权限,继续刷新 [英] Facebook App Issue - Can not obtain Permissions , Keeps on refreshing

查看:102
本文介绍了Facebook App问题 - 无法获取权限,继续刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网上发现了这个爱情计算器应用程序,它是开源的,可以免费使用,我在我的测试服务器上设置了它,我添加了所有的应用程序ID和秘密并完成了所有设置,但是当我得到这个权限问题时我或其他人试图使用它,这个脚本中有3个重要文件,



Config.php(我设置了它,它只有4个字段用于app id,secret,canvas url,app domain)

Index.php

Facebook.php(这是我认为的sdk)

Config .php使用以下代码加载到Index.php中

 include_once('  LIB / facebook.php');  //   Facebook客户端库 
include_once(' config.php'); // 配置文件

// 常量位于config.php文件中
$ facebook = < span class =code-keyword> new
Facebook(
数组(
' appId' => FACEBOOK_APP_ID,
' secret' => FACEBOOK_SECRET_KEY,
' cookie' => true,
domain' => FACEBOOK_DOMAIN

);



现在,当我试图找出问题时,我在index.php中找到了用于获取权限的代码



  $ session  = $ facebook-&g吨;的getSession(); 

if (!$ session){
$ url = $ facebook-> getLoginUrl(array(
' canvas' => 1,
' fbconnect' => 0,
' scope' => ' publish_stream'
));
echo < script type =' text / javascript'> top.location.href ='$ url';< / script>;
} 其他 {
尝试 {
$ uid = $ facebook-> getUser();
$ me = $ facebook-> api(' /我);
$ updated = date( l, F j,Y,strtotime($ me [' updated_time']));
} catch (FacebookApiException $ e){
echo < script type ='text / javascript'> top.location.href ='$ url';< / script>< /跨度>;
退出;
}
}



画布应用网址为https://apps.facebook.com/fb-love-calculator-f域名网址是https://apps.mjobz.com/love/

解决方案

facebook = new Facebook(
阵列(
' appId' => FACEBOOK_APP_ID,
' secret' => FACEBOOK_SECRET_KEY,
' cookie' => true,
' domain' => FACEBOOK_DOMAIN

);



现在,当我试图弄清楚问题,我在index.php中找到了获取权限的代码



  


session =


facebook->的getSession();

if (!


I found this Love Calculator app online , It is open source and free to use, I setted it up on my test server, I added all the app Id's and secrets and did all the setting but I am getting this permissions issue when I or Someone else try to use it , There are 3 Important files in this script,

Config.php (i setted it up , it has only 4 fields for the app id,secret,canvas url,app domain)
Index.php
Facebook.php (this is the sdk I figure)
Config.php is loaded in Index.php with the following code

include_once ('lib/facebook.php'); // Facebook client library
include_once ('config.php'); // Config file

// Constants are located in config.php file
$facebook = new Facebook(
    array(
        'appId'  => FACEBOOK_APP_ID,
        'secret' => FACEBOOK_SECRET_KEY,
        'cookie' => true,
        'domain' => FACEBOOK_DOMAIN
    )
);


Now , When I tried to figure out the problem , I found this code in index.php for obtaining permissions

$session = $facebook->getSession();

if (!$session) {
    $url = $facebook->getLoginUrl(array(
               'canvas' => 1,
               'fbconnect' => 0,
               'scope' => 'publish_stream'
           ));
    echo "<script type='text/javascript'>top.location.href = '$url';</script>";
} else {
    try {
        $uid = $facebook->getUser();
        $me = $facebook->api('/me');
        $updated = date("l, F j, Y", strtotime($me['updated_time']));
    } catch (FacebookApiException $e) {
        echo "<script type='text/javascript'>top.location.href = '$url';</script>";
    exit;
    } 
}


The canvas app url is https://apps.facebook.com/fb-love-calculator-f The domain url is https://apps.mjobz.com/love/

解决方案

facebook = new Facebook( array( 'appId' => FACEBOOK_APP_ID, 'secret' => FACEBOOK_SECRET_KEY, 'cookie' => true, 'domain' => FACEBOOK_DOMAIN ) );


Now , When I tried to figure out the problem , I found this code in index.php for obtaining permissions


session =


facebook->getSession(); if (!


这篇关于Facebook App问题 - 无法获取权限,继续刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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