我真的很感激一些帮助。我四处寻找,我觉得我已经尝试了一切,但无济于事。
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.
这些是我的设置:
App Domains: localhost
Canvas URL: http://localhost/friendsmash/
Secure Canvas URL: *empty*
App Available to Public: No
Valid OAuth redirect URIs: http://localhost/friendsmash/
编辑:
当我尝试转到画布URL时出现错误。换句话说,我说:
http://localhost/friendsmash/
然后,我看到了错误。当我转到画布页面时,我得到一个空白页面。至于代码,我正在学习本教程:https://developers.facebook.com/docs/games/canvas/canvas-tutorial
我审查了应用程序ID和秘密。无论如何,这是代码的相关部分:
<?php
require 'server/fb-php-sdk/facebook.php';
$app_id = 'XXXXXX';
$app_secret = 'XXXXXX';
$app_namespace = 'testappertest';
$app_url = 'https://apps.facebook.com/' . $app_namespace . '/';
$scope = 'email,publish_actions';
// Init the Facebook SDK
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
));
// Get the current user
$user = $facebook->getUser();
// If the user has not installed the app, redirect them to the Login Dialog
if (!$user) {
$loginUrl = $facebook->getLoginUrl(array(
'scope' => $scope,
'redirect_uri' => $app_url,
));
print('<script> top.location.href=\'' . $loginUrl . '\'</script>');
}
?>