The code I am using is directly from readme.

@graph = Koala::Facebook::API.new(oauth_access_token)
profile = @graph.get_object("me") // working perfectly fine..
friends = @graph.get_connections("me", "friends") // returning only my friends which are there in developer/admin list of the app.

Anything I am missing?

PS: App is not approved yet.

有帮助吗?

解决方案

Facebook just release its API 2.0 which change many permissions and friend_* endpoint is one of them you can read more here. Your problem mentioned in the link as

Friend list now only returns friends who also use your app: The list of friends returned via the /me/friends endpoint is now limited to the list of friends that have authorized your app.

其他提示

you simply add this line...

@graph = Koala::Facebook::API.new(facebook_token)
# perfectly get facebook friends count :)
@friends = @graph.get_connection("me", "friends",api_version:"v2.0").raw_response["summary"]["total_count"]
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top