Sarao
Sarao

Reputation: 379

Implementing facebook Ios SDK v4.0.1

I am integrating the latest Facebook IOS SDK(v4.0.1) in my sampleApp.
I am able to implement the login part easily.
But I am not able to fetch the user profile.
The app has the permission to access the user profile.
I think I am getting the user profile, but I don't know how to access it in my app.

For the older SDKs there are many tutorials available online, but for the newer SDKs I am not able to find any helpful tutorial.

Can anyone explain me please how can I fetch the data?

Upvotes: 0

Views: 296

Answers (1)

MMiroslav
MMiroslav

Reputation: 1762

Did you try to get profile from graph? Here is a snippet to do it:

if ([FBSDKAccessToken currentAccessToken]) {
   [[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:nil]
    startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
      if (!error) {
         NSLog(@”fetched user:%@”, result);
      }
  }];
}

You could find more info here: https://developers.facebook.com/docs/ios/graph

Upvotes: 1

Related Questions