如何使用Facebook API自动发布Facebook壁纸(仅与userid) [英] How to Post facebook wall automatically with Facebook API (only with userid)

查看:118
本文介绍了如何使用Facebook API自动发布Facebook壁纸(仅与userid)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我尝试发布到他们的墙上时,将重定向到Facebook登录页面。如果用户没有登录。

  $ status = $ facebook-> api('/ MY_USER_ID / feed' POST',
array('message'=>'这篇文章来自我的应用程序。

帮助我,但一些网络应用程序发布状态到我的墙,甚至我没有登录到Facebook 。



请帮我解决它:)

解决方案

代码可以帮助您获取用户的权限并访问用户的信息:

  $ dialog_url =http://www.facebook。 COM /对话框/ OAuth的?CLIENT_ID =。 $ app_id。 & redirect_uri =。 urlencode($ my_url)。 &安培;范围= publish_stream,user_about_me,read_friendlists,offline_access,publish_actions,friends_photos ,, user_photos。 & state =。 $ _SESSION [状态]; 

echo(< script> window.location.href ='$ dialog_url。'< / script>);


using fconnect user have authenticated and i have saved their userid to my database.

When i try to publish to their wall is redirecting to Facebook login page . If user haven't logged in.

$status = $facebook->api('/MY_USER_ID/feed', 'POST', 
   array('message' => 'This post came from my app.'));

Help me but some web app are posting status to my wall without even i havn't logged into facebook.

Please help me to fix it:)

解决方案

below code helps you to get permissions from user and access the user's information:

$dialog_url = "http://www.facebook.com/dialog/oauth?client_id=". $app_id . "&redirect_uri=" . urlencode($my_url) . "&scope=publish_stream,user_about_me,read_friendlists,offline_access,publish_actions,friends_photos,,user_photos". "&state=" . $_SESSION['state'];

echo("<script> window.location.href='" . $dialog_url . "'</script>");

这篇关于如何使用Facebook API自动发布Facebook壁纸(仅与userid)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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