Publishing comments on my Facebook app profil

旧时模样 提交于 2020-01-25 13:16:07

问题


My server is able to publish posts on my Facebook app wall. But I would like to publish comments on user writing on the wall... When trying to post a comment to a given post ID I always get the following:

{"error":{"type":"OAuthException","message":"(#200) The user hasn't authorized the application to perform this action"}}

However I gave all possible authorization as a test user to this app. Any suggestion ?

Addition.

I also tried to use the method described here The URL I'm using looks like this

curl_setopt($ch,CURLOPT_URL,'https://graph.facebook.com/'.$comment['id'].'/comments?'.$access_token)

Now I get the following message

{"error":{"type":"OAuthException","message":"(#100) Invalid fbid."}}


回答1:


OK found my own solution, but for the record since some people my stumble like me :

  1. first you need to apply this awesome authentification method.
  2. need to call facebook with the following

curl_setopt($ch, CURLOPT_POSTFIELDS, '&message=hello World'); curl_setopt($ch,CURLOPT_URL,'https://graph.facebook.com/'.$post['id'].'/comments?'.$access_token);




回答2:


If you can give some code, this would help. however, this is resulted usually from 3 reasons:

  1. The user hasn't installed your app.
  2. You didn't specify a VALID OAuth access token for this session with the query you performed.
  3. You don't have the publish_stream from the user, which you need to publish.-You said you have this, but did you specify this specific permission?



回答3:


My dear take the permission of publish_stream from the user. the error is just because of that. you can take publish stream like this

<fb:login-button perms="publish_stream" autologoutlink="true"></fb:login-button>


来源:https://stackoverflow.com/questions/4877847/publishing-comments-on-my-facebook-app-profil

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!