必须使用活动访问令牌来查询有关具有打开图的当前用户的信息
An active access token must be used to query information about the current user with open graph
大家好,我正在尝试发布我的facebook应用程序用户的活动,我按照教程一步一步地进行,但它不能正常工作。。。
警报消息显示错误"发生错误必须使用活动访问令牌来查询有关当前用户的信息"为什么??我的日志记录正确。
代码是这样的:
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"
xmlns:fb="https://www.facebook.com/2008/fbml">
<head prefix="og: http://ogp.me/ns# appnamespace:
http://ogp.me/ns/apps/appnamespace#">
<title>OG Tutorial App</title>
<meta property="fb:app_id" content="appID" />
<meta property="og:type" content="appnamespace:recipe" />
<meta property="og:title" content="Stuffed Cookies" />
<meta property="og:image" content="http://www.domain.com/logo.gif" />
<meta property="og:description" content="The Turducken of Cookies" />
<meta property="og:url" content="http://www.domain.com/activity.php">
<script type="text/javascript">
function postCook()
{
FB.api(
'/me/namespace:cook',
'post',
{ recipe: 'http://www.domain.com/activity.php' },
function(response) {
if (!response || response.error) {
alert('Error occured '+ response.error.message); // it shows "Error occured An active access token must be used to query information about the current user." message
} else {
alert('Cook was successful! Action ID: ' + response.id);
}
});
}
</script>
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'appID', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
<h3>Stuffed Cookies</h3>
<p>
<img title="Stuffed Cookies"
src="http://www.domain.com/logo.gif"
/>
</p>
<br>
<form>
<input type="button" value="Cook" onclick="postCook()" />
</form>
</body>
</html>
在您的源代码中,我看不到任何可以对用户进行身份验证的地方。用户必须首先授权您的应用程序,如下所述:https://developers.facebook.com/docs/authentication/client-side/
相关文章:
- 如何通过directline僵尸连接器发送用户信息
- 如何循环请求用户输入,直到用户在Acrobatneneneba XI中输入信息
- 在每个 AJAX 请求(Sencha Touch 2)中发送用户详细信息(会话令牌)
- 打开图形:Java脚本:必须使用活动访问令牌来查询有关当前用户的信息
- 从下拉框中选择用户信息,并使用进度计数器显示数据库中的选定项目
- 如何从帖子对象添加其他信息以在护照中注册用户
- 在/user/后面显示用户名的用户信息
- 当用户与谷歌地图交互时,如何从中获取信息
- 必须使用活动访问令牌来查询有关具有打开图的当前用户的信息
- Express通过页面向用户发送信息
- AngularJS如何解码带有令牌和内部用户信息的jsonp响应
- 如何从JavaScript访问Django登录的用户信息
- phonegap Facebook集成-从Facebook获取用户详细信息
- 正在尝试获取有关已验证用户的信息
- 如何使用html/html5中的用户输入获取完整的地理位置详细信息
- 如何将用户输入的信息从网站直接发送到我的电子邮件中
- 如何在角度 Js 中管理所有控制器的用户详细信息
- Javascript 来提醒用户已经输入了相同的信息
- 用于广告的 iframe ?获取用户信息
- 如何动态创建集合名称(取决于用户信息)