Facebook App问题 - 无法获取权限,继续刷新 [英] Facebook App Issue - Can not obtain Permissions , Keeps on refreshing
问题描述
我在网上发现了这个爱情计算器应用程序,它是开源的,可以免费使用,我在我的测试服务器上设置了它,我添加了所有的应用程序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 =
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, 这篇关于Facebook App问题 - 无法获取权限,继续刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
if (!
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 (!