I'm trying to get all gender from all my friends on facebook using OpenGraph Api and Facebook SDK.

Step 1 : OpenGraph

https://developers.facebook.com/tools/explorer/?method=GET&path=me%3Ffields%3Did%2Cname&version=v2.0

and query: xxxxxxid/friends?fields=gender

but with or without Limit field I get only few result.

What do I wrong?

有帮助吗?

解决方案

As per Facebook API v2.0, /{user}/friends will only return friends who already use your application.

friends endpoint will only return id and name (in v1.0 it also returned installed field, but not anymore as it's now restricted to app users only).

If still useful for you, you can get friends gender by calling /{user} on friend's IDs.

Cheers!

Edit: Removed user_birthday reference

其他提示

Only id and name is available via /me/friends on v2 of the platform, and then only for other users of your app. But if they use the app, then you can ask them using user_birthday.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top