Do review required if we want to get Facebook Page like count (Without Facebook login) by Facebook app token?

混江龙づ霸主 提交于 2019-12-11 21:23:10

问题


I am doing a static web page in my website, in which I am showing the like count of particular Facebook page. There is no kind of login required to see this web page. Also, I don't want to user to login with their Facebook account to see the Facebook page like count.

I have implemented this requirement by using Facebook app token.

API: "https://graph.facebook.com/PAGE_ID?access_token=APP_TOKEN"

But the problem here is, If I use the app token of already approved app by Facebook with some permissions (manage_pages) exists, it works. It is not working for the app token of newly created Facebook app.

I have sent the app for review to Facebook by requesting manage_pages permission, but they rejected the app and said that my website doesn't have the Facebook login functionality implemented.

Since it is not documented clearly, I have a doubt that do the app need to send for review if I want to get the Facebook page like count without Facebook login (By using Facebook app token)? If yes, what permission do I want to request?

Any help would be much appreciated.


回答1:


First of all, you need to learn what Tokens there are:

  • https://developers.facebook.com/docs/facebook-login/access-tokens
  • http://www.devils-heaven.com/facebook-access-tokens/

For your problem, you can just use an App Access Token. There is no need for any permission or Login Review, the links above tell you exactly how to create one. Make sure you never use the Token on the client, especially because it includes the App Secret. Do the API call on the server only (file_get_contents or curl, if you use PHP).

If by "it does not work" you mean that you only get the id and the name, then it´s not about "not working", you need to read the changelog and search for "Declarative Fields": https://developers.facebook.com/docs/apps/changelog#v2_4

So if you want to get more than just id and name, the API call would be like this: https://graph.facebook.com/936299239766048?access_token=YOURAPPTOKEN&fields=id,name,likes,...



来源:https://stackoverflow.com/questions/33107620/do-review-required-if-we-want-to-get-facebook-page-like-count-without-facebook

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