You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FbGraph2 gem deprecated several features implemented in FbGraph gem.
See more details Deprecations.
Debugging
If you have troubles and want to see raw HTTP request/response, read Debugging.
Putting raw http response is always better than putting ruby backtrace when reporting FbGraph2 bug.
Access Tokens
FB provide several ways to get access tokens.
Using JS SDK
Using iOS/Android SDK
Raw OAuth2 Flow
FB iframe Apps
Since each way has different security characteristics, you should understand them and decide which way is the best for your use-case.
See more details Obtain Access Tokens.
GET /v2.0/user_id HTTP/1.1
Authorization: Bearer access_token
Host: graph.facebook.com
and user.fetch returns FbGraph::User instance which holds user attributes and edges described in the official document.
Each attributes and edges returns “reasonable” ruby object.
# User Attributesuser.name# => Stringuser.email# => Stringuser.cover# => FbGraph2::Photouser.hometown# => FbGraph2::Page# User Edgesuser.family# => Array of FbGraph2::Useruser.feed# => Array of FbGraph2::Postuser.picture# => FbGraph2::Struct::Picture
For supported object types, ask object_classes on FbGraph2 module.
FbGraph2.object_classes
For supported edge types, ask edges on an object instance.
user.edges# => Array of String
This is the basic usage of fb_graph2.
I hope you can “feel” how to use this gem.
More UseCases
Will add more code samples & use-cases as your request.