response.authResponse is null

房东的猫 提交于 2019-12-01 01:48:17

To be able to call the graph to get likes, you will need to have the user add/authenticate your app with the user_likes permissions and then you can read it. So in your code above, when they fall into either of the two else cases, call FB.login() (or display the fb login button on the page).

If you don't want to force the user to add/authenticate your app, then you will need to configure your app as a Page Tab app and then you can grab the signed_request (https://developers.facebook.com/docs/authentication/signed_request/) and decode that providing access to know if the user has liked the page that your app is a page tab of.

The authResponse object is null if you're not connected... since you're haven't authorized this seems logical ...

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