Cannot get page like for some users

自作多情 提交于 2019-12-05 23:38:26

Don't mistake the permissions in the app center with those you pass to your scope. When prompting the user for permissions, do you have added "user_likes" to the scope?

With the JS-SDK you do it like that for example:

FB.login(function(response) {
    // Do some fancy stuff
}, {scope: 'user_likes'});

Also make sure you have a valid user access token. Your PHP-SDK provides a method called "getAccessToken()", which returns the current access token.

You can also simply try to print the results of getUser() which returns the userID of the current user. If you get 0, you can be pretty sure that the user is not connected with your facebook app and you'll therefore not be able to use me() in FQL queries.

Also query the graph API with /{user-id}/permissions. You'll get a json object returned that contains all the permissions the user gave. Of course you need a valid connected user with your app in order to do that.

I hope I could give you some helpful advice. If nothing helped try posting more code.

Happy Coding!

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