FBSDK (New Facebook SDK 4.0) Implementation is not working for Login with Facebook

后端 未结 5 2041
予麋鹿
予麋鹿 2021-01-01 19:35

I am using this following block which is mentioned in Facebook Developer. But when my App callbacks from Browser then it

5条回答
  •  一生所求
    2021-01-01 20:18

    You use this simple block with your expected requirements

    if ([FBSDKAccessToken currentAccessToken])
    {
          [[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:nil]
                     startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id user, NSError *error)
           {
               if (!error)
               {
                //  NSDictionary *dictUser = (NSDictionary *)user;
                // This dictionary contain user Information which is possible to get from Facebook account.
               }
            }];
    }
    

    Access Token you will get only and only after successfully login

    Hope this will help you

提交回复
热议问题