Using the Facebook Graph API
The FBSDK lets us make requests to the Facebook Graph API using the GraphRequest
and GraphRequestManager
classes to create those requests and execute them.
GraphRequest
is used to create a request to the Graph API, while GraphRequestManager
is called to execute that request.
GraphRequest
To instantiate a new GraphRequest
, we can pass up to three arguments:
graphPath
: This is a string pertaining to the endpoint in the Graph API that we wish to hit. For example, to get information about the logged-in user, agraphPath
of/me
will be used.config
: This is an optional object that can configure the request. The props that this object accepts are all optional:httpMethod
: This is a string that describes the HTTP method for this request, for example,GET
orPOST
.version
: This is a string that describes the specific Graph API version to use.parameters
: This is an object containing the request's parameters.accessToken
: This is a stringified version of the access token used...