Embed fb in the ios swift app

0
Good afternoon guys, all good? I would like to know if integrating the fb sdk in my project ios swift if the user log in I have access to his friends list? And taking advantage of the question, would anyone have any tutorial on integration? Thanks

    
asked by anonymous 26.09.2015 / 16:05

1 answer

1

You can, provided that when you authenticate with Facebook, you request permission user_friends to access the list of friends.

The request to pick up the friends list is as follows:

let meRequest = FBSDKGraphRequest(graphPath: "me/friends", parameters: nil)
meRequest.startWithCompletionHandler({ (connection: FBSDKGraphRequestConnection!, result: AnyObject!, error: NSError!) -> Void in
   if (error != nil) {
       println(result) // Lista de amigos (paginada)
   } 
})

A great place to start with integrating with the Facebook SDK is their own page: Facebook SDK for iOS - Getting Started

    
26.09.2015 / 18:02