我正在尝试使用以下javascript代码发布操作:
FB.api('/me/spacemaze:fly_through',
'post',
{maze: 'http://www.gethugames.in/html5spacemaze/', lid: state.currentLevel, score: 1001},
function(resp) {
if(!resp || resp.error) {
console.log('err occured');
console.log(resp.error);
} else {
console.log('successfull action');
console.log(resp);
}
});
但请求失败并收到以下错误:
code: 1
message: "An unknown error has occurred."
type: "OAuthException"
在Open Graph Dashboard中,fly_through
被定义为包含2个自定义属性lid
和score
float
类型的操作。 Maze
是一个Object,我没有创建任何聚合。
我的代码出了什么问题?
编辑1:
我获得了访问令牌,验证它在访问令牌调试器中有效,但“问题”字段显示为未知。不确定这是不是问题。
然后在Graph API资源管理器中,我发布了一个包含以下字段的查询
URL: me/spacemaze:fly_through
maze: http://www.gethugames.in/html5spacemaze
lid: 5
score: 10.1
但得到同样的错误:
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1
}
PS:我在扩展权限下获得publish_stream
和read_stream
的权限。不够吗?