从页面或应用发布到Facebook用户的墙上

从页面或应用发布到Facebook用户的墙上

问题描述:

I can get a user to authorize my app and later on I can post on their wall with this code:

new Facebook(...);
$facebook->api('/'.$uid.'/feed', 'post', array('message' => 'My app says hi'));

This works but the post that appears on the user's wall is by the user (it has their face and name next to the post with "via My App" next to it). Is there a way to have the post appear to be by the app (or my page) with my profile photo and name next to it?

I have tried many variations of the above including getting the app access token explicitly as documented but this gives the same result.

Is it possible for an app or page to post on a user's wall as itself rather than pretending to be the user?

我可以让用户授权我的应用程序,稍后我可以使用以下代码发布在他们的墙上: p>

  new Facebook(...); 
 $ facebook-> api('/'。$ uid。'/ feed','post',array('message'  =>'我的应用说你好')); 
  code>  pre> 
 
 

这样可行,但用户墙上显示的帖子由用户 strong >(它的脸和名字旁边的帖子旁边有“via My App”)。 有没有办法让帖子看起来是应用程序(或我的页面)旁边有我的个人资料照片和名字? p>

我尝试了上述的许多变化,包括获取 应用程序访问令牌明确地记录,但这会得到相同的结果。 p>

应用程序或页面是否可以作为自己在用户的墙上发布而不是伪装成用户? p> div>

It's not possible to post on the user's wall as app or page. And even if it's possible, it's not recommended!

Your best bet if you want to notify your fans about something is to post on your page's wall (as your page) where this post will appear in your fans news feed.

Also this can be done for your website fans (Likers): https://developers.facebook.com/blog/post/465/

you are authorizing the app with your users credentials as you said, right? That's why your posts are created by that user. You have to authorize the app with user name who has access to the page admin section.

And use from and to payload to facebook api.

Ref: https://developers.facebook.com/docs/reference/api/post/

To publish a 'photo' object you need

  1. a valid access token
  2. publish_stream permission

and for code refer to this page