nov / fb_graph

This gem doesn't support FB Graph API v2.0+. Please use fb_graph2 gem instead.
MIT License
1.04k stars 191 forks source link

Support the new v2 API permissions format. #359

Closed recurser closed 10 years ago

recurser commented 10 years ago

Facebook v2 API permissions are returned in a different format to v1. See v1 vs. v2 documentation.

Instead of:

{ "publish_actions": 1, ... }

... we now get:

[{ "permission": "publish_actions", "status": "granted" }, ...]

I was hesitant to dive into adding v2 support in fb_graph-mock, so the tests are a bit of a hack.

nov commented 10 years ago

FYI: fb_graph2 is the newer version of fb_graph https://github.com/nov/fb_graph2

nov commented 10 years ago

Thanks for your contribution. Permission v2 support now in fb_graph v2.7.14

recurser commented 10 years ago

@nov thanks for your work on fb_graph - much appreciated!

nov commented 10 years ago

support specifying api_version per api call. https://github.com/nov/fb_graph/blob/master/spec/fb_graph/connections/permissions_spec.rb#L65

ps. even in that case, FbGraph.v2? returns global setting, so I modified FbGraph::Connection::Permissions like this. https://github.com/nov/fb_graph/blob/master/lib/fb_graph/connections/permissions.rb#L6