Search code examples
iosobjective-cswiftios8sharing

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


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

FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
[login logInWithReadPermissions:@[@"email"]     
        handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
  if (error) {
        // Process error
   }
  else if (result.isCancelled) {
        // Handle cancellations
   }
   else {
       // If you ask for multiple permissions at once, you
       // should check if specific permissions missing
       if ([result.grantedPermissions containsObject:@"email"]) {
        // Do work
       }
  }
 }];

this update comes on 25 March 15,

If anyone used this then please share it with me.

Reference : https://developers.facebook.com/docs/ios/getting-started


Solution

  • You cant get Email id from Facebook Login....why???

    If your Facebook account registered using "Mobile Number", and you do not have Email in same account.

    Check this scenario. This might be happening, We cant blame for it to FBSDK.

    Hope this will clear some points.