Issue
I'm going slightly mad because of my problem. I prepared facebook app based on facebook-php-sdk. My app's permisions are:
publish_acions, user_location, user_likes, friends_likes
Everything goes correct with that code:
$facebook = new Facebook(array(
'appId' => '####',
'secret' => '####',
));
I can also receive
$user = $facebook->getUser();
$user_profile = $facebook->api('/me');
$userId = $user_profile['id'];
But I can't receive
$user_likes = $facebook->api('/me/likes/');
It just gives me an empty array (I'm quite sure I like the page). So what's the reason? Thanks in advance...
Solution
First of all: Use The JavaScript for the login process, it´s much easier to handle and debug. Also, it´s better for the usability, because it does not redirect: https://developers.facebook.com/docs/reference/javascript/FB.login/v2.1
Use the "scope" parameter as it is mentioned in the docs and check if the required permissions are really asked for in the authorization popups.
Btw, the correct endpoint would be /me/likes (without the slash at the end), just another idea why it does not work.
And then there is the review process, most permissions (like user_likes) need to get approved by Facebook before they can be used for other users (except for users with a role in the App settings). Check out the changelog and the review guidelines for more information:
- https://developers.facebook.com/docs/apps/changelog
- https://developers.facebook.com/docs/apps/review/login
Friend permissions are deprecated btw, there is no "friends_likes" anymore.
Answered By - andyrandy
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.