質問

I'm trying to get friends count via my account using Facebook API. Its working well.

But if i get friends count using one of my friendId, i'm getting the following exception

Tests in error:
friendsCount(com.company.facebook.test.FbClientTest): Received Facebook error response of type OAuthException: (#604) Can't lookup all friends of 649390517. Can only lookup for the logged in user or the logged in user's friends that are users of your app.

役に立ちましたか?

解決

That error message seems pretty clear, you can't access friends-of-friends via the API unless the other friend also uses your app.

You can however check for mutual friends between your app's user and any arbitrary user ID.

To do that, make an API call to

/USER_ID/mutualfriends/OTHER_USER_ID

Where USER_ID is the user who's authorised your app, and OTHER_USER_ID is the user you want to check for mutual friends with.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top