M
M
Maxim Prigozhenkov2015-10-18 15:35:36
Facebook
Maxim Prigozhenkov, 2015-10-18 15:35:36

How to get token in ios facebook sdk?

For several days I have been trying to implement authorization through Facebook in the application.
I can’t get the user’s access_token and, accordingly, his profile information (first name, last name, etc.).
Here is an example of a custom button code taken from the Facebook documentation:

FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
    [login
     logInWithReadPermissions: @[@"public_profile"]
     fromViewController:self
     handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
         NSLog(@"Result: %@", [result token]);
     }];

As a result null is returned.
How do you still get the token and profile information? Maybe I'm doing something wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question