In my project I'm using FacebookSDK, I need to get friends list with pagination, so how can I get friends count and friends list (offset "value", limit 10) in one FQL query?

my queries are:

SELECT friend_count FROM user WHERE uid = me()
SELECT uid2 FROM friend WHERE uid1 = me() LIMIT 10 OFFSET 0

Thanks in advance.

有帮助吗?

解决方案

You need to encode your two queries as a JSON object and pass that object as the query to the /fql endpoint:

{
  'num_friends':'SELECT friend_count FROM user WHERE uid = me()',
  'ten_friends':'SELECT uid2 FROM friend WHERE uid1 = me() LIMIT 10 OFFSET 0'
}

For specific information on using multiqueries with the iOS SDK, see step 2b of this tutorial

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