問題描述
在應(yīng)用程序域中添加了域,還添加了有效的 OAuth 重定向 URI.. 但是,收到這樣的錯(cuò)誤消息我已經(jīng)盡力了...任何人都可以幫助我......這很令人惱火,我正在失去耐心并開始恐慌.我真的不知道,我在這方面犯了什么大錯(cuò).查看以下圖片以了解有關(guān)我的問題的更多信息
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. I really don't know, what is my big mistake in this. See this following images to know more about my problem
推薦答案
我們有 3 種方法來解決它
We have 3 ways to fix it
1) 關(guān)閉
對重定向 URI 使用嚴(yán)格模式
Use Strict Mode for Redirect URIs
在 Facebook 登錄 -> 設(shè)置
in Facebook Login-> Settings
2)
$accessToken = $helper->getAccessToken();
到
$accessToken = $helper->getAccessToken('https://example.com/your-CallBack-URI-page.php');
3) 當(dāng)您不想浪費(fèi)時(shí)間用于生產(chǎn)用途時(shí),這適用于開發(fā)目的
3) This is fine for development purpose when you don't want to waste time, for production use
session_start();
require_once __DIR__ . '/vendor/autoload.php';
$fb = new FacebookFacebook([
'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(FacebookExceptionsFacebookResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(FacebookExceptionsFacebookSDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
這篇關(guān)于圖返回錯(cuò)誤:無法加載 URL:此 URL 的域未包含在應(yīng)用程序的域中的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!