philippec / PhFacebook

MacOSX Interface to Facebook graph API
http://developer.casgrain.com/?p=107
Other
178 stars 44 forks source link

Running multiple FQL queries #39

Closed raffael closed 11 years ago

raffael commented 11 years ago

With the new changes in the Graph API, FQL queries can now be made using the graph.facebook.com instead of api.facebook.com. The sendFQLRequest should be rewritten to implement that change.

Additionally, multiple queries can now be executed at once using braces notation:

graph.facebook.com/fql?q={"user+info":"SELECT … ","photo+info":"SELECT …"}

Currently, sending requests containing {, } or _ (Space) with PhFacebook result in empty result strings. To fix that, the following code can be used:

NSString fqlQuery = @"fql?q={\"...\":\"…", ...}"; NSString properlyEncodedString = [fqlQuery stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];

The properlyEncodedString now results in correct Graph results.

philippec commented 11 years ago

If you have a code fix that can allow both single and multiple queries at the same time, send a pull request and I'll review it. Thanks!