O'Reilly logo

Integrating Facebook iOS SDK with Your Application by Giuseppe Macrì

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the Graph API with Facebook iOS SDK

In order to use Graph APIs in our social application, we are going to use a component called FBRequestConnection.

The previous class has convenient methods to perform Graph API calls and handles responses flawlessly, as it will create a single HTTP connection with the social platform. FBRequestConnection works only if the current FBSession is open and has a valid token.

The duties of FBRequestConnection are as follows:

  • Creating the correct URI for your Graph API request and appending the correct URN to the base Graph Facebook URL (http://graph.facebook.com/)
  • Fetching the current active FBSession, extracting the security token associated, and attaching the security token to the Graph API request
  • Handling

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required