[英]Graph returned an error: Can't Load URL: The domain of this URL isn't included in the app's domains
Added domain in App Domains, Valid OAuth redirect URIs also added.. but, Getting error message like this I have done my best... Anybody help me... it was quite irritating, I'm loosing my patience and getting panic. 在App Domains中添加了域,还添加了有效的OAuth重定向URI ..但是,收到这样的错误消息我已经尽了最大努力......任何人都帮助我...这令人非常恼火,我正在失去耐心并感到恐慌。 I really don't know, what is my big mistake in this. 我真的不知道,这是我最大的错误。 See this following images to know more about my problem 请参阅以下图片以了解有关我的问题的更多信息
We have 3 ways to fix it 我们有3种方法可以解决它
1) Turn Off 1)关闭
Use Strict Mode for Redirect URIs 使用严格模式重定向URI
in Facebook Login-> Settings 在Facebook登录 - >设置
2) 2)
$accessToken = $helper->getAccessToken();
to 至
$accessToken = $helper->getAccessToken('https://example.com/your-CallBack-URI-page.php');
3) This is fine for development purpose when you don't want to waste time, for production use 3)当您不想浪费时间用于生产时,这对于开发目的是好的
session_start();
require_once __DIR__ . '/vendor/autoload.php';
$fb = new Facebook\Facebook([
'app_id' => 'appid',
'app_secret' => 'app secret',
'default_graph_version' => 'v2.6 ',
"persistent_data_handler"=>"session"
]);
$helper = $fb->getRedirectLoginHelper();
$permissions = ['email']; // optional
$loginUrl = $helper->getLoginUrl('domain.com/php-graph-sdk-5.x/login-callback.php/', $permissions);
$_SESSION['FBRLH_state']=$_GET['state'];
try {
$accessToken = $helper->getAccessToken('domian.com/php-graph-sdk-5.x/login-callback.php/');
} catch(Facebook\Exceptions\FacebookResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.