0

I am using xcode8 and I have enabled all but its not working

1)Enabled key chain in app.

2)InAppdelegate.m

didFinishLaunching method
 [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];

-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

    return [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];

}

I have a custom button in my viewcontroller file for "login with FB" the button action is

-(void)signInWithFaceBookAction {

    FBSDKLoginManager *loginManager = [[FBSDKLoginManager alloc] init];
    [loginManager logInWithReadPermissions:@[@"public_profile", @"email", @"user_friends"]
                        fromViewController:self
                                   handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
                                       //TODO: process error or result
                                       NSLog(@"Results :%@ --- Error:%@",result,error.description);
                                       NSLog(@"Token:%@ -- isCancelled:%d -- Granted Permissions:%@ -- Declined permissions:%@",result.token,result.isCancelled,result.grantedPermissions,result.declinedPermissions);

                                           NSMutableDictionary* parameters = [NSMutableDictionary dictionary];
                                           [parameters setValue:@"id,name,email" forKey:@"fields"];

                                           [[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:parameters]
                                            startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
                                                NSLog(@"Result :%@",result);
                                                NSLog(@"Error: %@",error.localizedDescription);
                                            }];

                                   }];


}
Super Xtreem
  • 187
  • 1
  • 10
  • refer my answer in the link https://stackoverflow.com/questions/37874383/facebook-login-page-showing-blank-page-in-ios-9 – MuraliMohan Nov 18 '16 at 18:21
  • As suggested in this https://stackoverflow.com/questions/37874383/facebook-login-page-showing-blank-page-in-ios-9 I cannot seem to add two methods in appdelegate, Duplicate declaration error showing up – Super Xtreem Nov 19 '16 at 05:56
  • Boss both are different methods. one less than ios 9 and other is from ios 10.Both will support. try copy past and check whether you are getting error or not – MuraliMohan Nov 20 '16 at 13:44

0 Answers0