我正在努力让我的第一个应用程序获得批准,我有大约10个测试人员和应用程序的工作对我和他们来说都很好。 问题是,当我提交它以供审批时,审核人说他无法登录,并且我在登录后显示了一个空白页面。 这是index.php的简化版本
<?php
session_start();
set_time_limit(0);
date_default_timezone_set('Europe/Rome');
require_once( 'libraries/Facebook/FacebookSession.php' );
require_once( 'libraries/Facebook/FacebookRedirectLoginHelper.php' );
require_once( 'libraries/Facebook/FacebookRequest.php' );
require_once( 'libraries/Facebook/FacebookResponse.php' );
require_once( 'libraries/Facebook/FacebookSDKException.php' );
require_once( 'libraries/Facebook/FacebookRequestException.php' );
require_once( 'libraries/Facebook/FacebookOtherException.php' );
require_once( 'libraries/Facebook/FacebookPermissionException.php' );
require_once( 'libraries/Facebook/FacebookAuthorizationException.php' );
require_once( 'libraries/Facebook/GraphObject.php' );
require_once( 'libraries/Facebook/GraphUser.php' );
require_once( 'libraries/Facebook/GraphSessionInfo.php' );
require_once( 'libraries/Facebook/FacebookServerException.php' );
use Facebook\FacebookSession;
use Facebook\FacebookRedirectLoginHelper;
use Facebook\FacebookRequest;
use Facebook\FacebookResponse;
use Facebook\FacebookSDKException;
use Facebook\FacebookRequestException;
use Facebook\FacebookAuthorizationException;
use Facebook\GraphObject;
use Facebook\GraphUser;
use Facebook\GraphSessionInfo;
$id = 'app_id';
$secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxx';
$permissions = array(
'user_videos',
'user_posts',
'public_profile'
);
FacebookSession::setDefaultApplication($id, $secret);
$helper = new FacebookRedirectLoginHelper('http://app_url.com');
try{
$session = $helper->getSessionFromRedirect();
}catch(Exception $e){
}
if(isset($_SESSION['token'])){
$session = new FacebookSession($_SESSION['token']);
try{
$session->Validate($id, $secret);
}catch(FacebookAuthorizationException $e){
$session = '';
}
}
if(isset($session)){
/* do something*/
}
else{
$loginUrl = $helper->getLoginUrl( $permissions );
$_SESSION['login'] = $loginUrl;
include 'php/login.php';
}
在error.log中我收到了这个错误:
[17-Aug-2015 20:09:30 Europe/Rome] PHP Fatal error: Uncaught exception 'Facebook\FacebookSDKException' with message 'Session has expired, or is not valid for this app.' in /home/user/public_html/my_app/libraries/Facebook/FacebookSession.php:196
Stack trace:
#0 /home/nicosh/public_html/my_app/libraries/Facebook/FacebookSession.php(174): Facebook\FacebookSession::validateSessionInfo(Object(Facebook\GraphSessionInfo), 'xxxxxxxxxxxxxxxx...', 'xxxxxxxxxxxxxxxxx...')
#1 /home/nicosh/public_html/my_app/index.php(58): Facebook\FacebookSession->validate('xxxxxxxxxxxxxxxx...', 'xxxxxxxxxxxxxxxxxx...')
#2 {main}
thrown in /home/user/public_html/my_app/libraries/Facebook/FacebookSession.php on line 196
现在,我/我的测试人员和fb评论员之间存在差异
1个不同的位置,我们来自意大利,我设置date_default_timezone_set('Europe/Rome');
会导致错误吗?每次我都会在下午01点收到审稿人团队的通知,所以这是与美国不同的一天,这会影响令牌的创建吗?
2-me /测试人员在app的角色中扮演着重要角色。
有什么想法或建议吗?
谢谢Nico。