如何使用新的Facebook API登录用户墙? [英] How to post to user's wall without logging in, using the new Facebook API?
本文介绍了如何使用新的Facebook API登录用户墙?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经存储了Facebook用户ID和Facebook的朋友ID。如何发布到用户的墙壁,而不登录到Facebook?
I have stored a Facebook user ID and a Facebook friend ID. How can I publish to the user's wall without logging into Facebook?
我已经使用了具有UID和target_id字段的旧Facebook API:
I have used the old Facebook API that has UID and target_id fields like this:
$param = array(
'method' => 'stream.publish',
'callback' => '',
'message' => $row[message],
'attachment' => json_encode($attachment),
'target_id' => $row[friends_id],
'uid' => $row[sender_id],
'privacy' => ''
);
$result = $facebook->api($param);
这是否可能在新的Facebook PHP API?
Is this possible in new facebook PHP API?
$attachment = array('message' => $wall);
$facebook->api("/$target/feed/",'post', $attachment);
该应用程序具有墙壁发布权限。
The application has wall posting permissions.
推荐答案
只有当你有access_token与offline_permission被授予时,这是可能的。
如果你拥有它,然后在$附件中包含关键字access_token的标记
this is possible only if you have the access_token with offline_permission granted. if you have it, then include the token in $attachment with key "access_token"
这篇关于如何使用新的Facebook API登录用户墙?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文