Skip to content

Instantly share code, notes, and snippets.

@evangow
Created September 29, 2017 17:12
Show Gist options
  • Save evangow/a483db742f2b5a7db9c3461a212f8b67 to your computer and use it in GitHub Desktop.
Save evangow/a483db742f2b5a7db9c3461a212f8b67 to your computer and use it in GitHub Desktop.
How to call the Facebook API with your access token
loadGroupFeed = (accessToken) => {
  return new Promise((resolve, reject) => {
    FB.api(
      "/<Group-ID-here>/feed",
      { access_token: accessToken },
      function (response) {
        if (!response || response.error) {
          reject(response.error)
        } else {
          resolve(response)
        }
      }
    );
  });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment