Facebook Graph API:使用用户Facebook ID和access_token发布给离线用户 [英] Facebook Graph API : Publish to offline user, with user Facebook ID and access_token

查看:134
本文介绍了Facebook Graph API:使用用户Facebook ID和access_token发布给离线用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PHP/MySQL,我想为一些离线用户发布内容,我已经拥有publish_stream和offline_access的权限,如何使用Graph API发布到该用户墙,我已经存储了用户ID和access_token在我的数据库中.

I'm using PHP/MySQL, and I want to publish for some offline users, I have already both permissions for publish_stream and offline_access, how to publish with the Graph API to this user wall, I already stored users ID's and access_token in my Database.

该怎么做??

当前代码对我不起作用,php文件在此行停止执行:

the current code is not working for me, the php file stop execution at this line :

$result = $facebook->api('/'.$users[fid].'/feed?access_token='.$users[session].'/', 'post', $attachment);

谢谢.

推荐答案

确保$ attachment数据的格式正确.另外,您的帖子字符串有误,请尝试:

Make sure your $attachment data is properly formatted. Also your post string is wrong, try:

$result = $facebook->api('/'.$users[fid].'/feed?access_token='.$users[session], 'post', $attachment);

还要确保您的offline_access令牌有效

这篇关于Facebook Graph API:使用用户Facebook ID和access_token发布给离线用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆