Pet*_*ter 2 facebook facebook-fql facebook-graph-api
我怎样才能获得当前的戳(并回拨)?
Normaly他们必须在表中"通知"......我很困惑.
希望可以有人帮帮我.
这是一个提示read_mailbox权限并使用/ me/pokes检索用户戳的工作示例.这也可以使用相同的逻辑在任何服务器端语言中完成.
得到戳:
<!DOCTYPE html>
<html>
<body>
<div id="fb-root"></div>
<a href="#" onclick="getPokes();return false;">Get Pokes</a>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({ appId : '**yourAppID', status : true, cookie : true, xfbml : true });
function getPokes() {
FB.login(function(response) {
if (response.session && response.perms) {
FB.api('/me/pokes', function(response) {
for(var i=0; i < response.data.length; i++) {
alert(response.data[i].from.name + " poked you.");
}
}
);
}
} , {perms:'read_mailbox'});
}
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
回过头来: 要回拨用户,你可以向/ userid/pokes发布HTTP帖子,但你需要通过Facebook列入白名单.否则你会得到这个回复:
{
error: {
type: "OAuthException",
message: "(#3) Application does not have the capability to make this API call.",
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2325 次 |
| 最近记录: |