Basycally what I would like to do is to :
true
or false
to each item of this collectionI've managed to retrieve the Facebook friends of the current user and serve it to my app like so
UserController
def facebook_friends
@friends = graph.get_connections("me", "friends")
end
RABL
object false
node :data do @friends
end
It returns something like:
{
data: [{
'id': '23456789'
'name': 'Bobby Brown'
}, {
'id': '23456788'
'name': 'Bobby Black'
}]
}
but what I would like is something like this:
{
data: [{
'id': '23456789'
'name': 'Bobby Brown',
'registered': true
}, {
'id': '23456788'
'name': 'Bobby Black',
'registered': false
}]
}
But I have no idea how to do the second part without wasting too much resources.
There is simple Graph API query for that.
me/friends?fields=id,name,installed
https://developers.facebook.com/tools/explorer/
It returns JSON. Users who installed app have installed: true
@graph.get_connections('me','friends',:fields=>"id,name,installed")