Skip to main content
The Facebook Graph API is the primary way to read and write data to Facebook’s social graph. This guide shows you how to make Graph API requests using React Native FBSDK Next.
Graph API requests cannot be made with a Limited Login Authentication Token on iOS. You must use an Access Token from traditional login.

Prerequisites

Before making Graph API requests:
  1. User must be logged in with traditional Facebook Login
  2. You must have a valid Access Token
  3. User must have granted appropriate permissions

Making Graph Requests

Basic Request

Use GraphRequest and GraphRequestManager to make API calls:

Request with Parameters

Add parameters to customize the request:

Using Async/Await

Wrap Graph requests in a Promise for cleaner code:

Common Graph API Endpoints

Get User Profile

Get User’s Friends

Get User’s Photos

Get User’s Posts

Request Configuration

HTTP Methods

Specify the HTTP method for your request:

API Version

Specify a Graph API version:

Custom Access Token

Use a specific access token:

Batch Requests

Make multiple Graph API requests in a single network call:

Pagination

Handle paginated results:

Error Handling

Common Errors

Checking Permissions

Verify permissions before making requests:

Complete Example

Here’s a complete example of fetching and displaying user data:

Best Practices

1. Always Check Token Validity

2. Request Only Needed Fields

Be specific about which fields you need:

3. Cache Responses

Cache Graph API responses to reduce network calls:

4. Handle Rate Limiting

Facebook limits API calls. Handle rate limit errors:

See Also

Authentication

Learn about access tokens and authentication

Graph Request API

Complete API reference for GraphRequest

Facebook Graph API Docs

Official Facebook Graph API documentation

Permissions Reference

Complete list of Facebook permissions